{"old_contents":"package io.github.saidie.plantuml_api;\n\nimport java.util.List;\nimport javax.persistence.CascadeType;\nimport javax.persistence.Column;\nimport javax.persistence.Entity;\nimport javax.persistence.GeneratedValue;\nimport javax.persistence.Id;\nimport javax.persistence.OneToMany;\nimport javax.validation.constraints.NotNull;\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\n\n@Entity\n@Data\n@NoArgsConstructor\n@AllArgsConstructor\npublic class Account {\n @Id\n @GeneratedValue\n private long id;\n\n @NotNull\n @Column(nullable = false)\n private String username;\n\n @OneToMany(mappedBy = \"account\", cascade = CascadeType.ALL)\n private List federations;\n}\n","new_contents":"package io.github.saidie.plantuml_api;\n\nimport javax.persistence.Column;\nimport javax.persistence.Entity;\nimport javax.persistence.GeneratedValue;\nimport javax.persistence.Id;\nimport javax.validation.constraints.NotNull;\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\n\n@Entity\n@Data\n@NoArgsConstructor\n@AllArgsConstructor\npublic class Account {\n @Id\n @GeneratedValue\n private long id;\n\n @NotNull\n @Column(nullable = false)\n private String username;\n}\n","subject":"Remove a dependency from account to federations"} {"old_contents":"package org.twig.syntax.parser.node.type;\n\nimport org.twig.compiler.*;\nimport org.twig.syntax.parser.node.Node;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\n\npublic class Text extends Node {\n public Text(ArrayList nodes, HashMap attributes, Integer line, String tag) {\n super(nodes, attributes, line, tag);\n }\n\n public Text(Integer line) {\n super(line);\n }\n\n @Override\n public void compile(ClassCompiler compiler) {\n String text = String.valueOf(attributes.get(\"data\"));\n compiler.write(\"output = output.concat(\");\n compiler.writeString(text);\n compiler.writeLine(\");\");\n }\n}\n","new_contents":"package org.twig.syntax.parser.node.type;\n\nimport org.twig.compiler.*;\nimport org.twig.syntax.parser.node.Node;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\n\npublic class Text extends Node {\n public Text(ArrayList nodes, HashMap attributes, Integer line, String tag) {\n super(nodes, attributes, line, tag);\n }\n\n public Text(Integer line) {\n super(line);\n }\n\n @Override\n public void compile(ClassCompiler compiler) {\n String text = String.valueOf(attributes.get(\"data\"));\n compiler.write(\"output = output.concat(\");\n compiler.writeString(text);\n compiler.writeRaw(\");\\n\");\n }\n}\n","subject":"Make formatting of text node nicer"} {"old_contents":"package seedu.address.commons.core;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\n\nimport seedu.task.commons.core.Config;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertTrue;\n\npublic class ConfigTest {\n @Rule\n public ExpectedException thrown = ExpectedException.none();\n\n @Test\n public void toString_defaultObject_stringReturned() {\n String defaultConfigAsString = \"App title : Address App\\n\" +\n \"Current log level : INFO\\n\" +\n \"Preference file Location : preferences.json\\n\" +\n \"Local data file location : data\/taskmanager.xml\\n\" +\n \"TaskManager name : MyTaskManager\";\n\n assertEquals(defaultConfigAsString, new Config().toString());\n }\n\n @Test\n public void equalsMethod(){\n Config defaultConfig = new Config();\n assertFalse(defaultConfig.equals(null));\n assertTrue(defaultConfig.equals(defaultConfig));\n }\n\n\n}\n","new_contents":"package seedu.address.commons.core;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\n\nimport seedu.task.commons.core.Config;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertTrue;\n\npublic class ConfigTest {\n @Rule\n public ExpectedException thrown = ExpectedException.none();\n\n @Test\n public void toString_defaultObject_stringReturned() {\n String defaultConfigAsString = \"App title : Task Manager\\n\" +\n \"Current log level : INFO\\n\" +\n \"Preference file Location : preferences.json\\n\" +\n \"Local data file location : data\/taskmanager.xml\\n\" +\n \"TaskManager name : MyTaskManager\";\n\n assertEquals(defaultConfigAsString, new Config().toString());\n }\n\n @Test\n public void equalsMethod(){\n Config defaultConfig = new Config();\n assertFalse(defaultConfig.equals(null));\n assertTrue(defaultConfig.equals(defaultConfig));\n }\n\n\n}\n","subject":"Change 'Address App' to Task Manager'"} {"old_contents":"package org.edx.mobile.base;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.support.annotation.Nullable;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport org.edx.mobile.event.NewRelicEvent;\n\nimport de.greenrobot.event.EventBus;\nimport roboguice.fragment.RoboFragment;\n\npublic class BaseFragment extends RoboFragment {\n private boolean isFirstVisit;\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n EventBus.getDefault().post(new NewRelicEvent(getClass().getSimpleName()));\n }\n\n @Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n isFirstVisit = true;\n return super.onCreateView(inflater, container, savedInstanceState);\n }\n\n @Override\n public void onResume() {\n super.onResume();\n if (isFirstVisit) {\n isFirstVisit = false;\n } else {\n onRevisit();\n }\n }\n\n \/**\n * Called when a Fragment is re-displayed to the user (the user has navigated back to it).\n * Defined to mock the behavior of {@link Activity#onRestart() Activity.onRestart} function.\n *\/\n protected void onRevisit() {\n }\n}\n","new_contents":"package org.edx.mobile.base;\n\nimport android.app.Activity;\nimport android.os.Bundle;\n\nimport org.edx.mobile.event.NewRelicEvent;\n\nimport de.greenrobot.event.EventBus;\nimport roboguice.fragment.RoboFragment;\n\npublic class BaseFragment extends RoboFragment {\n private boolean isFirstVisit = true;\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n EventBus.getDefault().post(new NewRelicEvent(getClass().getSimpleName()));\n }\n\n @Override\n public void onResume() {\n super.onResume();\n if (isFirstVisit) {\n isFirstVisit = false;\n } else {\n onRevisit();\n }\n }\n\n \/**\n * Called when a Fragment is re-displayed to the user (the user has navigated back to it).\n * Defined to mock the behavior of {@link Activity#onRestart() Activity.onRestart} function.\n *\/\n protected void onRevisit() {\n }\n}\n","subject":"Fix 'onRevisit' callback calls wrongly issue."} {"old_contents":"package <%=packageName%>.web.rest.errors;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n\/**\n * Custom, parameterized exception, which can be translated on the client side.\n * For example:\n *\n *
\n * throw new CustomParameterizedException("myCustomError", "hello", "world");\n * <\/pre>\n *\n * Can be translated with:\n *\n * 
\n * \"error.myCustomError\" :  \"The server says {{param0}} to {{param1}}\"\n * <\/pre>\n *\/\npublic class CustomParameterizedException extends RuntimeException {\n\n    private static final long serialVersionUID = 1L;\n\n    private static final String PARAM = \"param\";\n\n    private final String message;\n    private Map paramMap;\n\n    public CustomParameterizedException(String message, String... params) {\n        super(message);\n        this.message = message;\n        if (params != null && params.length > 0) {\n            this.paramMap = new HashMap<>();\n            for (int i = 0; i < params.length; i++) {\n                paramMap.put(PARAM + i, params[i]);\n            }\n        }\n    }\n\n    public CustomParameterizedException(String message, Map paramMap) {\n        super(message);\n        this.message = message;\n        this.paramMap = paramMap;\n    }\n\n    public ParameterizedErrorVM getErrorVM() {\n        return new ParameterizedErrorVM(message, paramMap);\n    }\n\n}\n","new_contents":"package <%=packageName%>.web.rest.errors;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n\/**\n * Custom, parameterized exception, which can be translated on the client side.\n * For example:\n *\n * 
\n * throw new CustomParameterizedException("myCustomError", "hello", "world");\n * <\/pre>\n *\n * Can be translated with:\n *\n * 
\n * \"error.myCustomError\" :  \"The server says {{param0}} to {{param1}}\"\n * <\/pre>\n *\/\npublic class CustomParameterizedException extends RuntimeException {\n\n    private static final long serialVersionUID = 1L;\n\n    private static final String PARAM = \"param\";\n\n    private final String message;\n\n    private final Map paramMap = new HashMap<>();\n\n    public CustomParameterizedException(String message, String... params) {\n        super(message);\n        this.message = message;\n        if (params != null && params.length > 0) {\n            for (int i = 0; i < params.length; i++) {\n                paramMap.put(PARAM + i, params[i]);\n            }\n        }\n    }\n\n    public CustomParameterizedException(String message, Map paramMap) {\n        super(message);\n        this.message = message;\n        this.paramMap.putAll(paramMap);\n    }\n\n    public ParameterizedErrorVM getErrorVM() {\n        return new ParameterizedErrorVM(message, paramMap);\n    }\n}\n","subject":"Change code to make Sonar happy"}
{"old_contents":"\/*\n * generated by Xtext\n *\/\npackage org.yakindu.base.expressions.ui;\n\nimport org.eclipse.ui.plugin.AbstractUIPlugin;\n\n\/**\n * Use this class to register components to be used within the IDE.\n *\/\npublic class ExpressionsUiModule extends org.yakindu.base.expressions.ui.AbstractExpressionsUiModule {\n\tpublic ExpressionsUiModule(AbstractUIPlugin plugin) {\n\t\tsuper(plugin);\n\t}\n}\n","new_contents":"\/*\n * generated by Xtext\n *\/\npackage org.yakindu.base.expressions.ui;\n\nimport org.eclipse.ui.plugin.AbstractUIPlugin;\nimport org.eclipse.xtext.ui.editor.model.IResourceForEditorInputFactory;\nimport org.eclipse.xtext.ui.editor.model.JavaClassPathResourceForIEditorInputFactory;\nimport org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory;\nimport org.eclipse.xtext.ui.resource.IResourceSetProvider;\nimport org.eclipse.xtext.ui.resource.SimpleResourceSetProvider;\nimport org.eclipse.xtext.ui.resource.XtextResourceSetProvider;\nimport org.eclipse.xtext.ui.shared.Access;\n\n\/**\n * Use this class to register components to be used within the IDE.\n *\/\npublic class ExpressionsUiModule extends org.yakindu.base.expressions.ui.AbstractExpressionsUiModule {\n\tpublic ExpressionsUiModule(AbstractUIPlugin plugin) {\n\t\tsuper(plugin);\n\t}\n\n\tpublic com.google.inject.Provider provideIAllContainersState() {\n\t\tif (Access.getJdtHelper().get().isJavaCoreAvailable()) {\n\t\t\treturn Access.getJavaProjectsState();\n\t\t} else {\n\t\t\treturn Access.getWorkspaceProjectsState();\n\t\t}\n\t}\n\n\t@Override\n\tpublic Class bindIResourceSetProvider() {\n\t\tif (Access.getJdtHelper().get().isJavaCoreAvailable()) {\n\t\t\treturn XtextResourceSetProvider.class;\n\t\t} else {\n\t\t\treturn SimpleResourceSetProvider.class;\n\t\t}\n\t}\n\n\t@Override\n\tpublic Class bindIResourceForEditorInputFactory() {\n\t\tif (Access.getJdtHelper().get().isJavaCoreAvailable()) {\n\t\t\treturn JavaClassPathResourceForIEditorInputFactory.class;\n\t\t} else {\n\t\t\treturn ResourceForIEditorInputFactory.class;\n\t\t}\n\t}\n}\n","subject":"Check if JST is available"}
{"old_contents":"package eu.scasefp7.eclipse.core.handlers;\r\n\r\nimport org.eclipse.core.commands.ExecutionEvent;\r\nimport org.eclipse.core.commands.ExecutionException;\r\n\r\n\/**\r\n * A command handler for exporting all service compositions to the linked ontology.\r\n * \r\n * @author themis\r\n *\/\r\npublic class CompileServiceCompositionsHandler extends CommandExecutorHandler {\r\n\r\n\t\/**\r\n\t * This function is called when the user selects the menu item. It populates the linked ontology.\r\n\t * \r\n\t * @param event the event containing the information about which file was selected.\r\n\t * @return the result of the execution which must be {@code null}.\r\n\t *\/\r\n\t@Override\r\n\tpublic Object execute(ExecutionEvent event) throws ExecutionException {\r\n\t\tif (getProjectOfExecutionEvent(event) != null) {\r\n\t\t\t\/\/ executeCommand(\"eu.scasefp7.eclipse.servicecomposition.commands.exportAllToOntology\");\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\tthrow new ExecutionException(\"No project selected\");\r\n\t\t}\r\n\t}\r\n\r\n}","new_contents":"package eu.scasefp7.eclipse.core.handlers;\r\n\r\nimport org.eclipse.core.commands.ExecutionEvent;\r\nimport org.eclipse.core.commands.ExecutionException;\r\n\r\n\/**\r\n * A command handler for exporting all service compositions to the linked ontology.\r\n * \r\n * @author themis\r\n *\/\r\npublic class CompileServiceCompositionsHandler extends CommandExecutorHandler {\r\n\r\n\t\/**\r\n\t * This function is called when the user selects the menu item. It populates the linked ontology.\r\n\t * \r\n\t * @param event the event containing the information about which file was selected.\r\n\t * @return the result of the execution which must be {@code null}.\r\n\t *\/\r\n\t@Override\r\n\tpublic Object execute(ExecutionEvent event) throws ExecutionException {\r\n\t\tif (getProjectOfExecutionEvent(event) != null) {\r\n\t\t\texecuteCommand(\"eu.scasefp7.eclipse.servicecomposition.commands.exportAllToOntology\");\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\tthrow new ExecutionException(\"No project selected\");\r\n\t\t}\r\n\t}\r\n\r\n}","subject":"Enable service compositions command to instantiate the linked ontology"}
{"old_contents":"\/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage io.trino.plugin.clickhouse;\n\nimport io.trino.plugin.jdbc.BaseJdbcConnectorSmokeTest;\nimport io.trino.testing.TestingConnectorBehavior;\nimport org.testng.annotations.Test;\n\npublic abstract class BaseClickHouseConnectorSmokeTest\n        extends BaseJdbcConnectorSmokeTest\n{\n    @Override\n    protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)\n    {\n        switch (connectorBehavior) {\n            case SUPPORTS_DELETE:\n                return false;\n            default:\n                return super.hasBehavior(connectorBehavior);\n        }\n    }\n\n    \/\/ TODO (https:\/\/github.com\/trinodb\/trino\/issues\/10653) Disable until fixing the flaky test issue\n    @Test(enabled = false)\n    @Override\n    public void testRenameSchema()\n    {\n        super.testRenameSchema();\n    }\n}\n","new_contents":"\/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage io.trino.plugin.clickhouse;\n\nimport io.trino.plugin.jdbc.BaseJdbcConnectorSmokeTest;\nimport io.trino.testing.TestingConnectorBehavior;\nimport org.testng.annotations.Test;\n\npublic abstract class BaseClickHouseConnectorSmokeTest\n        extends BaseJdbcConnectorSmokeTest\n{\n    @Override\n    protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)\n    {\n        switch (connectorBehavior) {\n            case SUPPORTS_DELETE:\n                return false;\n            default:\n                return super.hasBehavior(connectorBehavior);\n        }\n    }\n\n    @Test\n    @Override\n    public void testRenameSchema()\n    {\n        super.testRenameSchema();\n    }\n}\n","subject":"Enable testRenameSchema in ClickHouse smoke test"}
{"old_contents":"package replicant;\n\nimport org.testng.annotations.Test;\nimport static org.testng.Assert.*;\n\npublic class ConvergerTest\n  extends AbstractReplicantTest\n{\n  @Test\n  public void construct_withUnnecessaryContext()\n  {\n    final ReplicantContext context = Replicant.context();\n    final IllegalStateException exception =\n      expectThrows( IllegalStateException.class, () -> Converger.create( context ) );\n    assertEquals( exception.getMessage(),\n                  \"Replicant-0124: SubscriptioConvergernService passed a context but Replicant.areZonesEnabled() is false\" );\n  }\n\n  @Test\n  public void getReplicantContext()\n  {\n    final ReplicantContext context = Replicant.context();\n    final Converger converger = context.getConverger();\n    assertEquals( converger.getReplicantContext(), context );\n    assertEquals( getFieldValue( converger, \"_context\" ), null );\n  }\n}\n","new_contents":"package replicant;\n\nimport org.testng.annotations.Test;\nimport static org.testng.Assert.*;\n\npublic class ConvergerTest\n  extends AbstractReplicantTest\n{\n  @Test\n  public void construct_withUnnecessaryContext()\n  {\n    final ReplicantContext context = Replicant.context();\n    final IllegalStateException exception =\n      expectThrows( IllegalStateException.class, () -> Converger.create( context ) );\n    assertEquals( exception.getMessage(),\n                  \"Replicant-0124: SubscriptioConvergernService passed a context but Replicant.areZonesEnabled() is false\" );\n  }\n\n  @Test\n  public void getReplicantContext()\n  {\n    final ReplicantContext context = Replicant.context();\n    final Converger converger = context.getConverger();\n    assertEquals( converger.getReplicantContext(), context );\n    assertEquals( getFieldValue( converger, \"_context\" ), null );\n  }\n\n  @Test\n  public void getReplicantContext_zonesEnabled()\n  {\n    ReplicantTestUtil.enableZones();\n    ReplicantTestUtil.resetState();\n\n    final ReplicantContext context = Replicant.context();\n    final Converger converger = context.getConverger();\n    assertEquals( converger.getReplicantContext(), context );\n    assertEquals( getFieldValue( converger, \"_context\" ), context );\n  }\n}\n","subject":"Add test for getReplicantContext with zones enabled"}
{"old_contents":"package bwyap.familyfeud.game.fastmoney.state;\n\n\/**\n * States in a family feud game whilst playing Fast Money\n * @author bwyap\n *\n *\/\npublic enum FFFastMoneyStateType {\n\t\/\/ TODO\n\t;\n\t\n\tprivate String name;\n\t\n\tprivate FFFastMoneyStateType(String name) {\n\t\tthis.name = name;\n\t}\n\t\n\t@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}\n}\n","new_contents":"package bwyap.familyfeud.game.fastmoney.state;\n\n\/**\n * States in a family feud game whilst playing Fast Money\n * @author bwyap\n *\n *\/\npublic enum FFFastMoneyStateType {\n\t\n\tP1_ANSWER(\"p1 answer\"),\n\tP1_REVEAL(\"p1 reveal\"),\n\tP2_ANSWER(\"p2 answer\"),\n\tP2_REVEAL(\"p2 reveal\");\n\t\n\tprivate String name;\n\t\n\tprivate FFFastMoneyStateType(String name) {\n\t\tthis.name = name;\n\t}\n\t\n\t@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}\n}\n","subject":"Add Fast Money state types"}
{"old_contents":"\/*\nCopyright 2011-2017 Frederic Langlet\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nyou may obtain a copy of the License at\n\n                http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*\/\n\npackage kanzi.test;\n\nimport kanzi.util.sort.BucketSort;\nimport org.junit.Assert;\nimport org.junit.Test;\n\n\npublic class TestBucketSort extends TestAbstractSort\n{\n    @Test\n    public void testBucketSort()\n    {\n        Assert.assertTrue(testCorrectness(\"BucketSort\", new BucketSort(8), 20));\n        testSpeed(\"BucketSort\", new BucketSort(16), 20000, 0xFFFF);\n    }    \n}","new_contents":"\/*\nCopyright 2011-2017 Frederic Langlet\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nyou may obtain a copy of the License at\n\n                http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*\/\n\npackage kanzi.test;\n\nimport kanzi.util.sort.BucketSort;\nimport org.junit.Assert;\nimport org.junit.Test;\n\n\npublic class TestBucketSort extends TestAbstractSort\n{\n    @Test\n    public void testBucketSort()\n    {\n        Assert.assertTrue(testCorrectness(\"BucketSort\", new BucketSort(8), 20));\n        testSpeed(\"BucketSort\", new BucketSort(16), 10000, 0xFFFF);\n    }    \n}","subject":"Speed up test by reducing iterations."}
{"old_contents":"package com.opnitech.rules.core.test.engine.test_validators;\n\nimport org.junit.Test;\n\nimport com.opnitech.rules.core.test.engine.AbstractRuleEngineExecutorTest;\nimport com.opnitech.rules.core.test.engine.test_validators.group.InvalidGroupDefinition;\nimport com.opnitech.rules.core.test.engine.test_validators.group.ValidGroupDefinition;\nimport com.opnitech.rules.core.test.engine.test_validators.rules.group.InvalidGroupRule;\nimport com.opnitech.rules.core.test.engine.test_validators.rules.group.ValidGroupRule;\n\n\/**\n * @author Rigre Gregorio Garciandia Sonora\n *\/\npublic class GroupRuleValidatorTest extends AbstractRuleEngineExecutorTest {\n\n    @Test\n    public void testValidRule() throws Exception {\n\n        \/\/ Group need to be defined\n        validateRule(ValidGroupDefinition.class, new ValidGroupRule());\n    }\n\n    @Test\n    public void testValidRuleButNoGroupDefinition() throws Exception {\n\n        \/\/ Group need to be defined\n        validateExceptionRule(new ValidGroupRule());\n    }\n\n    @Test\n    public void testInvalidRuleButNoGroupDefinition() throws Exception {\n\n        validateExceptionRule(new InvalidGroupRule());\n    }\n\n    @Test\n    public void testInvalidRule() throws Exception {\n\n        validateExceptionRule(InvalidGroupDefinition.class, new InvalidGroupRule());\n    }\n}\n","new_contents":"package com.opnitech.rules.core.test.engine.test_validators;\n\nimport org.junit.Test;\n\nimport com.opnitech.rules.core.test.engine.AbstractRuleEngineExecutorTest;\nimport com.opnitech.rules.core.test.engine.test_validators.group.InvalidGroupDefinition;\nimport com.opnitech.rules.core.test.engine.test_validators.group.ValidGroupDefinition;\nimport com.opnitech.rules.core.test.engine.test_validators.rules.group.InvalidGroupRule;\nimport com.opnitech.rules.core.test.engine.test_validators.rules.group.ValidGroupRule;\n\n\/**\n * @author Rigre Gregorio Garciandia Sonora\n *\/\npublic class GroupRuleValidatorTest extends AbstractRuleEngineExecutorTest {\n\n    @Test\n    public void testValidRule() throws Exception {\n\n        \/\/ Group need to be defined\n        validateRule(ValidGroupDefinition.class, new ValidGroupRule());\n    }\n\n    @Test\n    public void testValidRuleButNoGroupDefinition() throws Exception {\n\n        \/\/ Group need to be defined\n        validateRule(new ValidGroupRule());\n    }\n\n    @Test\n    public void testInvalidRuleButNoGroupDefinition() throws Exception {\n\n        validateExceptionRule(new InvalidGroupRule());\n    }\n\n    @Test\n    public void testInvalidRule() throws Exception {\n\n        validateExceptionRule(InvalidGroupDefinition.class, new InvalidGroupRule());\n    }\n}\n","subject":"Fix some unit test after the implementation allowing grouped rules without the group definition declared as executable"}
{"old_contents":"\/*\n * Copyright 2020 ThoughtWorks, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.thoughtworks.gocd;\n\n\nimport java.util.Arrays;\nimport java.util.TreeSet;\n\npublic class AssertJava {\n    private static TreeSet SUPPORTED_VERSIONS = new TreeSet<>(Arrays.asList(\n            JavaVersion.VERSION_11,\n            JavaVersion.VERSION_12,\n            JavaVersion.VERSION_13,\n            JavaVersion.VERSION_14\n    ));\n\n    public static void assertVMVersion() {\n        checkSupported(JavaVersion.current());\n    }\n\n    private static void checkSupported(JavaVersion currentJavaVersion) {\n        if (!SUPPORTED_VERSIONS.contains(currentJavaVersion)) {\n            System.err.println(\"Running GoCD requires Java version >= \" + SUPPORTED_VERSIONS.first().name() +\n                    \" and <= \" + SUPPORTED_VERSIONS.last() +\n                    \". You are currently running with Java version \" + currentJavaVersion + \". GoCD will now exit!\");\n            System.exit(1);\n        }\n    }\n}\n","new_contents":"\/*\n * Copyright 2020 ThoughtWorks, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.thoughtworks.gocd;\n\n\nimport java.util.Arrays;\nimport java.util.TreeSet;\n\npublic class AssertJava {\n    private static TreeSet SUPPORTED_VERSIONS = new TreeSet<>(Arrays.asList(\n            JavaVersion.VERSION_11,\n            JavaVersion.VERSION_12,\n            JavaVersion.VERSION_13,\n            JavaVersion.VERSION_14,\n            JavaVersion.VERSION_15\n    ));\n\n    public static void assertVMVersion() {\n        checkSupported(JavaVersion.current());\n    }\n\n    private static void checkSupported(JavaVersion currentJavaVersion) {\n        if (!SUPPORTED_VERSIONS.contains(currentJavaVersion)) {\n            System.err.println(\"Running GoCD requires Java version >= \" + SUPPORTED_VERSIONS.first().name() +\n                    \" and <= \" + SUPPORTED_VERSIONS.last() +\n                    \". You are currently running with Java version \" + currentJavaVersion + \". GoCD will now exit!\");\n            System.exit(1);\n        }\n    }\n}\n","subject":"Allow JDK 15 in prep for 20.9.0"}
{"old_contents":"package io.cucumber.junit;\n\nimport io.cucumber.core.exception.CucumberException;\n\nimport java.lang.annotation.Annotation;\nimport java.lang.reflect.Method;\n\nfinal class Assertions {\n    private Assertions() {\n    }\n\n    static void assertNoCucumberAnnotatedMethods(Class clazz) {\n        for (Method method : clazz.getDeclaredMethods()) {\n            for (Annotation annotation : method.getAnnotations()) {\n                if (annotation.annotationType().getName().startsWith(\"cucumber\") \/\/TODO: Remove once migrated\n                 || annotation.annotationType().getName().startsWith(\"io.cucumber\")) {\n                    throw new CucumberException(\n                            \"\\n\\n\" +\n                                    \"Classes annotated with @RunWith(Cucumber.class) must not define any\\n\" +\n                                    \"Step Definition or Hook methods. Their sole purpose is to serve as\\n\" +\n                                    \"an entry point for JUnit. Step Definitions and Hooks should be defined\\n\" +\n                                    \"in their own classes. This allows them to be reused across features.\\n\" +\n                                    \"Offending class: \" + clazz + \"\\n\"\n                    );\n                }\n            }\n        }\n    }\n}\n","new_contents":"package io.cucumber.junit;\n\nimport io.cucumber.core.exception.CucumberException;\n\nimport java.lang.annotation.Annotation;\nimport java.lang.reflect.Method;\n\nfinal class Assertions {\n    private Assertions() {\n    }\n\n    static void assertNoCucumberAnnotatedMethods(Class clazz) {\n        for (Method method : clazz.getDeclaredMethods()) {\n            for (Annotation annotation : method.getAnnotations()) {\n                if (annotation.annotationType().getName().startsWith(\"io.cucumber\")) {\n                    throw new CucumberException(\n                            \"\\n\\n\" +\n                                    \"Classes annotated with @RunWith(Cucumber.class) must not define any\\n\" +\n                                    \"Step Definition or Hook methods. Their sole purpose is to serve as\\n\" +\n                                    \"an entry point for JUnit. Step Definitions and Hooks should be defined\\n\" +\n                                    \"in their own classes. This allows them to be reused across features.\\n\" +\n                                    \"Offending class: \" + clazz + \"\\n\"\n                    );\n                }\n            }\n        }\n    }\n}\n","subject":"Remove cucumber.api glue annotation check"}
{"old_contents":"package net.glowstone.scoreboard;\n\nimport lombok.Getter;\nimport lombok.RequiredArgsConstructor;\nimport lombok.Setter;\nimport net.glowstone.net.message.play.scoreboard.ScoreboardScoreMessage;\nimport org.bukkit.Bukkit;\nimport org.bukkit.OfflinePlayer;\nimport org.bukkit.scoreboard.Objective;\nimport org.bukkit.scoreboard.Score;\nimport org.bukkit.scoreboard.Scoreboard;\n\n\/**\n * Implementation\/data holder for Scores.\n *\/\n@RequiredArgsConstructor\npublic final class GlowScore implements Score {\n\n    @Getter\n    private final GlowObjective objective;\n    @Getter\n    private final String entry;\n    private int score;\n    @Getter\n    @Setter\n    private boolean locked;\n\n    @Override\n    public Scoreboard getScoreboard() {\n        return objective.getScoreboard();\n    }\n\n    @Override\n    @Deprecated\n    public OfflinePlayer getPlayer() {\n        return Bukkit.getOfflinePlayer(entry);\n    }\n\n    @Override\n    public int getScore() throws IllegalStateException {\n        objective.checkValid();\n        return score;\n    }\n\n    \/**\n     * Sets this score's value.\n     * @param score the new value\n     * @throws IllegalStateException if the objective is not registered on a scoreboard\n     *\/\n    @Override\n    public void setScore(int score) throws IllegalStateException {\n        objective.checkValid();\n        this.score = score;\n        objective.getScoreboard()\n            .broadcast(new ScoreboardScoreMessage(entry, objective.getName(), score));\n    }\n\n    @Override\n    public boolean isScoreSet() throws IllegalStateException {\n        objective.checkValid();\n        return objective.getScoreboard().getScores(entry).contains(this);\n    }\n}\n","new_contents":"package net.glowstone.scoreboard;\n\nimport lombok.Getter;\nimport lombok.RequiredArgsConstructor;\nimport lombok.Setter;\nimport net.glowstone.net.message.play.scoreboard.ScoreboardScoreMessage;\nimport org.bukkit.Bukkit;\nimport org.bukkit.OfflinePlayer;\nimport org.bukkit.scoreboard.Objective;\nimport org.bukkit.scoreboard.Score;\nimport org.bukkit.scoreboard.Scoreboard;\n\n\/**\n * Implementation\/data holder for Scores.\n *\/\n@RequiredArgsConstructor\npublic final class GlowScore implements Score {\n\n    @Getter\n    private final GlowObjective objective;\n    @Getter\n    private final String entry;\n    private int score;\n    @Setter\n    private boolean locked;\n\n    @Override\n    public Scoreboard getScoreboard() {\n        return objective.getScoreboard();\n    }\n\n    @Override\n    @Deprecated\n    public OfflinePlayer getPlayer() {\n        return Bukkit.getOfflinePlayer(entry);\n    }\n\n    @Override\n    public int getScore() throws IllegalStateException {\n        objective.checkValid();\n        return score;\n    }\n\n    \/**\n     * Sets this score's value.\n     * @param score the new value\n     * @throws IllegalStateException if the objective is not registered on a scoreboard\n     *\/\n    @Override\n    public void setScore(int score) throws IllegalStateException {\n        objective.checkValid();\n        this.score = score;\n        objective.getScoreboard()\n            .broadcast(new ScoreboardScoreMessage(entry, objective.getName(), score));\n    }\n\n    @Override\n    public boolean isScoreSet() throws IllegalStateException {\n        objective.checkValid();\n        return objective.getScoreboard().getScores(entry).contains(this);\n    }\n\n    public boolean getLocked() {\n        return locked;\n    }\n}\n","subject":"Revert getLocked (Lombokified name was isLocked)"}
{"old_contents":"package com.java.laiy;\n\nimport com.java.laiy.controller.Game;\nimport com.java.laiy.controller.GameController;\nimport com.java.laiy.model.Board;\nimport com.java.laiy.model.Figure;\nimport com.java.laiy.model.Player;\nimport com.java.laiy.view.ConsoleView;\n\npublic class Main {\n\n    public static void main(final String[] args) {\n        final String GAME_NAME = \"XO\";\n        final Board board = new Board();\n        final Player[] players = new Player[2];\n        players[0] = new Player(\"Xonstantin\", Figure.X);\n        players[1] = new Player(\"Oleg\", Figure.O);\n        final GameController gameController = new GameController(GAME_NAME, players, board);\n        final ConsoleView consoleView = new ConsoleView(gameController);\n        final Game game = new Game(consoleView,gameController);\n\n        game.theGame();\n    }\n\n\n}\n","new_contents":"\npackage com.java.laiy;\n\nimport com.java.laiy.view.ConsoleMenuView;\n\npublic class Main {\n\n    public static void main(final String[] args) {\n        ConsoleMenuView.showMenuWithResult();\n    }\n\n\n}","subject":"Move game start and settings to MenuView, MenuView renamed in ConsoleMenuView"}
{"old_contents":"package bj.pranie.config;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;\nimport org.springframework.security.config.annotation.web.builders.HttpSecurity;\nimport org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;\nimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;\n\n\/**\n * Created by noon on 13.10.16.\n *\/\n@Configuration\n@EnableWebSecurity\npublic class WebSecurityConfig extends WebSecurityConfigurerAdapter {\n    @Override\n    protected void configure(HttpSecurity http) throws Exception {\n        http.csrf().disable();\n        http.authorizeRequests()\n                .antMatchers(\"\/\", \"\/week\" ,\"\/week\/*\", \"\/wm\/*\", \"\/user\/registration\", \"\/user\/restore\", \"\/images\/*\", \"\/js\/*\").permitAll()\n                .anyRequest().authenticated()\n                .and()\n                .formLogin()\n                .loginPage(\"\/\")\n                .permitAll()\n                .and()\n                .logout()\n                .permitAll();\n    }\n\n    @Autowired\n    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {\n        auth.inMemoryAuthentication()\n                .withUser(\"admin\").password(\"admin\").roles(\"USER\");\n    }\n}","new_contents":"package bj.pranie.config;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;\nimport org.springframework.security.config.annotation.web.builders.HttpSecurity;\nimport org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;\nimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;\n\n\/**\n * Created by noon on 13.10.16.\n *\/\n@Configuration\n@EnableWebSecurity\npublic class WebSecurityConfig extends WebSecurityConfigurerAdapter {\n    @Override\n    protected void configure(HttpSecurity http) throws Exception {\n        http.csrf().disable();\n        http.authorizeRequests()\n                .antMatchers(\"\/\", \"\/week\" ,\"\/week\/*\", \"\/wm\/*\/*\", \"\/user\/registration\", \"\/user\/restore\", \"\/images\/*\", \"\/js\/*\").permitAll()\n                .anyRequest().authenticated()\n                .and()\n                .formLogin()\n                .loginPage(\"\/\")\n                .permitAll()\n                .and()\n                .logout()\n                .permitAll();\n    }\n\n    @Autowired\n    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {\n        auth.inMemoryAuthentication()\n                .withUser(\"admin\").password(\"admin\").roles(\"USER\");\n    }\n}","subject":"Change path to site no requested authorization."}
{"old_contents":"package info.sleeplessacorn.nomagi.client;\n\nimport net.minecraft.block.state.IBlockState;\nimport net.minecraft.client.renderer.block.model.ModelResourceLocation;\nimport net.minecraft.client.renderer.block.statemap.StateMapperBase;\nimport net.minecraft.util.ResourceLocation;\nimport net.minecraftforge.fml.common.Loader;\n\n\/**\n * Used for blocks that implement the Chisel CTM format\n *\n * When Chisel is not loaded, a secondary blockstate file, with {@code _noctm} appended, is used instead.\n *\/\npublic class StateMapperNoCTM extends StateMapperBase {\n\n    @Override\n    protected ModelResourceLocation getModelResourceLocation(IBlockState state) {\n        ResourceLocation location = state.getBlock().getRegistryName();\n        if (!Loader.isModLoaded(\"chisel\"))\n            location = new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + \"_noctm\");\n\n        return new ModelResourceLocation(location, getPropertyString(state.getProperties()));\n    }\n}\n","new_contents":"package info.sleeplessacorn.nomagi.client;\n\nimport net.minecraft.block.state.IBlockState;\nimport net.minecraft.client.renderer.block.model.ModelResourceLocation;\nimport net.minecraft.client.renderer.block.statemap.StateMapperBase;\nimport net.minecraft.util.ResourceLocation;\nimport net.minecraftforge.fml.common.Loader;\n\n\/**\n * Used for blocks that implement the Chisel CTM format\n *\n * When neither Chisel nor ConnectedTexturesMod are loaded, a secondary blockstate file, with {@code _noctm} appended, is used instead.\n *\/\npublic class StateMapperNoCTM extends StateMapperBase {\n\n    @Override\n    protected ModelResourceLocation getModelResourceLocation(IBlockState state) {\n        ResourceLocation location = state.getBlock().getRegistryName();\n        if (!Loader.isModLoaded(\"chisel\") || !Loader.isModLoaded(\"ctm\"))\n            location = new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + \"_noctm\");\n\n        return new ModelResourceLocation(location, getPropertyString(state.getProperties()));\n    }\n}\n","subject":"Update CTM statemapper to check for ConnectedTexturesMod"}
{"old_contents":"\/*\n * ToroDB\n * Copyright © 2014 8Kdata Technology (www.8kdata.com)\n *\n * This program is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\/\n\npackage com.torodb.packaging.config.validation;\n\nimport com.torodb.packaging.config.model.protocol.mongo.AbstractReplication;\n\nimport javax.validation.ConstraintValidator;\nimport javax.validation.ConstraintValidatorContext;\n\npublic class MutualExclusiveReplSetOrShardsValidator implements\n    ConstraintValidator {\n\n  @Override\n  public void initialize(MutualExclusiveReplSetOrShards constraintAnnotation) {\n  }\n\n  @Override\n  public boolean isValid(AbstractReplication value, ConstraintValidatorContext context) {\n    if ((value.getShardList() != null && !value.getShardList().isEmpty())\n        && (value.getReplSetName().notDefault() || value.getSyncSource().notDefault())) {\n      return false;\n    }\n    \n    return true;\n  }\n}\n","new_contents":"\/*\n * ToroDB\n * Copyright © 2014 8Kdata Technology (www.8kdata.com)\n *\n * This program is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\/\n\npackage com.torodb.packaging.config.validation;\n\nimport com.torodb.packaging.config.model.protocol.mongo.AbstractReplication;\n\nimport javax.validation.ConstraintValidator;\nimport javax.validation.ConstraintValidatorContext;\n\npublic class MutualExclusiveReplSetOrShardsValidator implements\n    ConstraintValidator> {\n\n  @Override\n  public void initialize(MutualExclusiveReplSetOrShards constraintAnnotation) {\n  }\n\n  @Override\n  public boolean isValid(AbstractReplication value, ConstraintValidatorContext context) {\n    if ((value.getShardList() != null && !value.getShardList().isEmpty())\n        && value.getSyncSource().notDefault()) {\n      return false;\n    }\n    \n    return true;\n  }\n}\n","subject":"Allow a commond replSetName for all shards"}
{"old_contents":"package net.stickycode.configured.finder;\n\nimport static org.fest.assertions.Assertions.assertThat;\n\nimport org.junit.Test;\n\npublic abstract class AbstractBeanFinderTest {\n\n  protected abstract BeanFinder getFinder();\n\n  @Test\n  public void lookupPrototype() {\n    Bean bean = getFinder().find(Bean.class);\n    assertThat(bean).isNotNull();\n    Bean bean2 = getFinder().find(Bean.class);\n    assertThat(bean).isNotSameAs(bean2);\n  }\n\n  @Test\n  public void lookupSingleton() {\n    BeanFinder finder = getFinder();\n    SingletonBean bean = finder.find(SingletonBean.class);\n    assertThat(bean).isNotNull();\n    SingletonBean bean2 = finder.find(SingletonBean.class);\n    assertThat(bean).isSameAs(bean2);\n  }\n\n  @Test(expected = BeanNotFoundException.class)\n  public void notFound() {\n    getFinder().find(getClass());\n  }\n\n  @Test\n  \/\/ (expected = BeanNotFoundException.class)\n  public void tooMany() {\n    getFinder().find(TooMany.class);\n  }\n}\n","new_contents":"package net.stickycode.configured.finder;\n\nimport static org.fest.assertions.Assertions.assertThat;\n\nimport org.junit.Test;\n\npublic abstract class AbstractBeanFinderTest {\n\n  protected abstract BeanFinder getFinder();\n\n  @Test\n  public void lookupPrototype() {\n    Bean bean = getFinder().find(Bean.class);\n    assertThat(bean).isNotNull();\n    Bean bean2 = getFinder().find(Bean.class);\n    assertThat(bean).isNotSameAs(bean2);\n  }\n\n  @Test\n  public void lookupSingleton() {\n    BeanFinder finder = getFinder();\n    SingletonBean bean = finder.find(SingletonBean.class);\n    assertThat(bean).isNotNull();\n    SingletonBean bean2 = finder.find(SingletonBean.class);\n    assertThat(bean).isSameAs(bean2);\n  }\n\n  @Test(expected = BeanNotFoundException.class)\n  public void notFound() {\n    getFinder().find(getClass());\n  }\n\n  @Test(expected = BeanNotFoundException.class)\n  public void tooMany() {\n    getFinder().find(TooMany.class);\n  }\n}\n","subject":"Enable the correct exception check on the test, was disabled when inspecting the contents of the exception"}
{"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *    http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.apache.eagle.jobrunning.url;\n\n\npublic class JobCompletedConfigServiceURLBuilderImpl implements ServiceURLBuilder {\n\t\n\tpublic String build(String ... parameters) {\n\t\t\/\/ parameters[0] = baseUrl, parameters[1] = jobID\n\t\t\/\/ {historyUrl}\/jobhistory\/conf\/job_xxxxxxxxxxxxx_xxxxxx\t\t\n\t\treturn parameters[0] + \"jobhistory\/conf\/\" + parameters[1];\t\t\n\t}\n}\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *    http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.apache.eagle.jobrunning.url;\n\n\nimport org.apache.eagle.jobrunning.common.JobConstants;\n\npublic class JobCompletedConfigServiceURLBuilderImpl implements ServiceURLBuilder {\n\t\n\tpublic String build(String ... parameters) {\n\t\t\/\/ parameters[0] = baseUrl, parameters[1] = jobID\n\t\t\/\/ {historyUrl}\/jobhistory\/conf\/job_xxxxxxxxxxxxx_xxxxxx\t\t\n\t\treturn parameters[0] + \"jobhistory\/conf\/\" + parameters[1]\n\t\t\t\t+ \"?\" + JobConstants.ANONYMOUS_PARAMETER;\n\t}\n}\n","subject":"Add a missing anonymous parameter in hive running spout"}
{"old_contents":"package com.intellij.find.findUsages;\n\nimport com.intellij.openapi.project.Project;\nimport com.intellij.openapi.util.text.StringUtil;\nimport com.intellij.psi.PsiElement;\nimport com.intellij.usageView.UsageViewUtil;\n\nimport javax.swing.*;\n\n\/**\n * Created by IntelliJ IDEA.\n * User: max\n * Date: Feb 14, 2005\n * Time: 5:40:05 PM\n * To change this template use File | Settings | File Templates.\n *\/\npublic class CommonFindUsagesDialog extends AbstractFindUsagesDialog {\n  private PsiElement myPsiElement;\n\n  public CommonFindUsagesDialog(PsiElement element,\n                                Project project,\n                                FindUsagesOptions findUsagesOptions,\n                                boolean toShowInNewTab,\n                                boolean mustOpenInNewTab,\n                                boolean isSingleFile) {\n    super(project, findUsagesOptions, toShowInNewTab, mustOpenInNewTab, isSingleFile,\n          FindUsagesUtil.isSearchForTextOccurencesAvailable(element, isSingleFile), !isSingleFile && !element.getManager().isInProject(element));\n    myPsiElement = element;\n  }\n\n  protected JPanel createFindWhatPanel() {\n    return null;\n  }\n\n  protected JComponent getPreferredFocusedControl() {\n    return null;\n  }\n\n  public String getLabelText() {\n    return StringUtil.capitalize(UsageViewUtil.getType(myPsiElement)) + \" \" + UsageViewUtil.getDescriptiveName(myPsiElement);\n  }\n}\n","new_contents":"package com.intellij.find.findUsages;\n\nimport com.intellij.openapi.project.Project;\nimport com.intellij.openapi.util.text.StringUtil;\nimport com.intellij.psi.PsiElement;\nimport com.intellij.usageView.UsageViewUtil;\n\nimport javax.swing.*;\n\n\/**\n * Created by IntelliJ IDEA.\n * User: max\n * Date: Feb 14, 2005\n * Time: 5:40:05 PM\n * To change this template use File | Settings | File Templates.\n *\/\npublic class CommonFindUsagesDialog extends AbstractFindUsagesDialog {\n  private PsiElement myPsiElement;\n\n  public CommonFindUsagesDialog(PsiElement element,\n                                Project project,\n                                FindUsagesOptions findUsagesOptions,\n                                boolean toShowInNewTab,\n                                boolean mustOpenInNewTab,\n                                boolean isSingleFile) {\n    super(project, findUsagesOptions, toShowInNewTab, mustOpenInNewTab, isSingleFile,\n          FindUsagesUtil.isSearchForTextOccurencesAvailable(element, isSingleFile), !isSingleFile && !element.getManager().isInProject(element));\n    myPsiElement = element;\n    init();\n  }\n\n  protected JPanel createFindWhatPanel() {\n    return null;\n  }\n\n  protected JComponent getPreferredFocusedControl() {\n    return null;\n  }\n\n  public String getLabelText() {\n    return StringUtil.capitalize(UsageViewUtil.getType(myPsiElement)) + \" \" + UsageViewUtil.getDescriptiveName(myPsiElement);\n  }\n}\n","subject":"Fix non-java find usages dialogs."}
{"old_contents":"\/\/ Copyright 2019 Google LLC\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/     https:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.google.sps.servlets;\n\nimport java.io.IOException;\nimport javax.servlet.annotation.WebServlet;\nimport javax.servlet.http.HttpServlet;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\/** Servlet that takes in audio stream and retrieves \n ** user input string to display. *\/\n\n@WebServlet(\"\/audio-input\")\npublic class AudioInputServlet extends HttpServlet {\n\n  @Override\n  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n    response.setContentType(\"text\/html;\");\n    response.getWriter().println(\"

Hello world!<\/h1>\");\n }\n}\n","new_contents":"\/\/ Copyright 2019 Google LLC\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ https:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.google.sps.servlets;\nimport java.util.*;\n\nimport java.io.IOException;\nimport javax.servlet.annotation.WebServlet;\nimport javax.servlet.http.HttpServlet;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\/** Servlet that takes in audio stream and retrieves \n ** user input string to display. *\/\n\n@WebServlet(\"\/audio-input\")\npublic class AudioInputServlet extends HttpServlet {\n\n @Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n Object formdata = request.getParameter(\"file\");\n System.out.println(formdata);\n System.out.println(\"Got to servlet\");\n \/\/response.setContentType(\"text\/html;\");\n \/\/response.getWriter().println(\"

Hello world!<\/h1>\");\n }\n}\n","subject":"Add get retrieval of FormData"} {"old_contents":"package uk.co.alynn.games.ld30.world;\n\npublic abstract class Invader implements Adversary {\n\n private final float m_x, m_y;\n \n public Invader(float x, float y) {\n m_x = x;\n m_y = y;\n }\n \n @Override\n public String getImage() {\n return \"invader\";\n }\n\n @Override\n public float getX() {\n return m_x;\n }\n\n @Override\n public float getY() {\n return m_y;\n }\n \n abstract public Adversary update(float dt);\n\n @Override\n public Adversary hitPlayer(Runnable terminateGame) {\n return this;\n }\n\n @Override\n public Adversary hitBullet() {\n return null;\n }\n\n @Override\n public float getHeading() {\n return 0.0f;\n }\n\n}\n","new_contents":"package uk.co.alynn.games.ld30.world;\n\npublic abstract class Invader implements Adversary {\n\n private final float m_x, m_y;\n \n public Invader(float x, float y) {\n m_x = x;\n m_y = y;\n }\n \n @Override\n public String getImage() {\n return \"invader\";\n }\n\n @Override\n public float getX() {\n return m_x;\n }\n\n @Override\n public float getY() {\n return m_y;\n }\n \n abstract public Adversary update(float dt);\n\n @Override\n public Adversary hitPlayer(Runnable terminateGame) {\n terminateGame.run();\n return null;\n }\n\n @Override\n public Adversary hitBullet() {\n return null;\n }\n\n @Override\n public float getHeading() {\n return 0.0f;\n }\n\n}\n","subject":"Make collisions with invaders destroy the player"} {"old_contents":"package com.xdrop.passlock.core;\nimport org.apache.commons.codec.binary.Base64;\n\n\nimport com.xdrop.passlock.crypto.EncryptionModel;\nimport com.xdrop.passlock.crypto.aes.AESEncryptionData;\nimport com.xdrop.passlock.crypto.aes.AESEncryptionModel;\nimport com.xdrop.passlock.datasource.Datasource;\nimport com.xdrop.passlock.datasource.sqlite.SQLiteAESDatasource;\nimport com.xdrop.passlock.model.EncryptionData;\nimport com.xdrop.passlock.model.PasswordEntry;\nimport com.xdrop.passlock.utils.ByteUtils;\n\npublic class PasswordManager {\n\n public void addPassword(String description, char[] newPassword, String reference){\n\n EncryptionModel encryptionModel = new AESEncryptionModel();\n\n AESEncryptionData encryptionData = encryptionModel.encrypt(ByteUtils.getBytes(newPassword), pass.toCharArray());\n\n PasswordEntry passwordEntry = new PasswordEntry<>();\n passwordEntry.setDescription(description);\n passwordEntry.setRef(reference);\n passwordEntry.setEncryptionData(encryptionData);\n\n Datasource datasource = new SQLiteAESDatasource();\n datasource.addPass(reference, passwordEntry);\n\n\n byte[] b64 = Base64.encodeBase64(encryptionData.getEncryptedPayload());\n\n System.out.println(new String(b64));\n\n }\n\n\n\n}\n","new_contents":"package com.xdrop.passlock.core;\nimport org.apache.commons.codec.binary.Base64;\n\n\nimport com.xdrop.passlock.crypto.EncryptionModel;\nimport com.xdrop.passlock.crypto.aes.AESEncryptionData;\nimport com.xdrop.passlock.crypto.aes.AESEncryptionModel;\nimport com.xdrop.passlock.datasource.Datasource;\nimport com.xdrop.passlock.datasource.sqlite.SQLiteAESDatasource;\nimport com.xdrop.passlock.model.EncryptionData;\nimport com.xdrop.passlock.model.PasswordEntry;\nimport com.xdrop.passlock.utils.ByteUtils;\n\npublic class PasswordManager {\n\n public void addPassword(String description, char[] newPassword, char[] masterPass, String reference){\n\n EncryptionModel encryptionModel = new AESEncryptionModel();\n\n AESEncryptionData encryptionData = encryptionModel.encrypt(ByteUtils.getBytes(newPassword), masterPass);\n\n PasswordEntry passwordEntry = new PasswordEntry<>();\n passwordEntry.setDescription(description);\n passwordEntry.setRef(reference);\n passwordEntry.setEncryptionData(encryptionData);\n\n Datasource datasource = new SQLiteAESDatasource();\n datasource.addPass(reference, passwordEntry);\n\n\n byte[] b64 = Base64.encodeBase64(encryptionData.getEncryptedPayload());\n\n System.out.println(new String(b64));\n\n }\n\n\n\n}\n","subject":"Fix issue with missing var"} {"old_contents":"package org.ethereum.config.net;\n\nimport org.ethereum.config.blockchain.FrontierConfig;\n\n\/**\n * Created by Anton Nashatyrev on 25.02.2016.\n *\/\npublic class TestNetConfig extends AbstractNetConfig {\n public TestNetConfig() {\n add(0, new FrontierConfig());\n }\n}\n","new_contents":"package org.ethereum.config.net;\n\nimport org.ethereum.config.blockchain.FrontierConfig;\nimport org.ethereum.config.blockchain.HomesteadConfig;\n\n\/**\n * Created by Anton Nashatyrev on 25.02.2016.\n *\/\npublic class TestNetConfig extends AbstractNetConfig {\n public TestNetConfig() {\n add(0, new FrontierConfig());\n add(1_150_000, new HomesteadConfig());\n }\n}\n","subject":"Switch testnet config to Homestead"} {"old_contents":"public interface MatrixInterface {\n\t\/\/ boolean modify means function returns the modified matrix\n\t\/\/ no boolean modify means function returns a new matrix\n\n\t\/\/ matrix addition \n\tpublic Matrix m_add(Matrix m);\n\n\tpublic Matrix m_add(Matrix m, boolean modify);\n\n\n\t\/\/ matrix multiplication \n\tpublic Matrix m_multiply(Matrix m);\n\n\tpublic Matrix m_multiply(Matrix m, boolean modify);\n\n\n\t\/\/ transpose matrix \n\tpublic Matrix m_transpose(Matrix m);\n\n\tpublic Matrix m_transpose(Matrix m, boolean modify);\n\n\n\t\/\/ change element in matrix\n\tpublic void m_edit(double[][] a1);\n\n}","new_contents":"public interface MatrixInterface {\n\t\/\/ boolean modify means function returns the modified matrix\n\t\/\/ no boolean modify means function returns a new matrix\n\n\t\/\/ matrix addition \n\tpublic Matrix add(Matrix m);\n\n\tpublic Matrix add(Matrix m, boolean modify);\n\n\n\t\/\/ matrix multiplication \n\tpublic Matrix multiply(Matrix m);\n\n\tpublic Matrix multiply(Matrix m, boolean modify);\n\n\n\t\/\/ transpose matrix \n\tpublic Matrix transpose(Matrix m);\n\n\tpublic Matrix transpose(Matrix m, boolean modify);\n\n\n\t\/\/ change element in matrix\n\tpublic double[][] edit();\n\n}","subject":"Fix method names and change edit"} {"old_contents":"\/*\n * Copyright 2015 Hewlett-Packard Development Company, L.P.\n * Licensed under the MIT License (the \"License\"); you may not use this file except in compliance with the License.\n *\/\n\npackage com.hp.autonomy.hod.client.api.textindex;\n\n\/**\n * Enum type representing the possible options for the index flavor parameter\n *\/\npublic enum IndexFlavor {\n standard,\n explorer,\n categorization,\n custom_fields,\n web_cloud,\n querymanipulation\n}\n","new_contents":"\/*\n * Copyright 2015 Hewlett-Packard Development Company, L.P.\n * Licensed under the MIT License (the \"License\"); you may not use this file except in compliance with the License.\n *\/\n\npackage com.hp.autonomy.hod.client.api.textindex;\n\n\/**\n * Enum type representing the possible options for the index flavor parameter\n *\/\npublic enum IndexFlavor {\n standard,\n explorer,\n categorization,\n custom_fields,\n querymanipulation\n}\n","subject":"Remove web_cloud as it can't be used to create a text index"} {"old_contents":"package com.microsoft.azure.documentdb.sample.dao;\n\nimport com.microsoft.azure.documentdb.ConnectionPolicy;\nimport com.microsoft.azure.documentdb.ConsistencyLevel;\nimport com.microsoft.azure.documentdb.DocumentClient;\n\npublic class DocumentClientFactory {\n private static final String HOST = \"https:\/\/docdb-java-sample.documents.azure.com:443\/\";\n private static final String MASTER_KEY = \"[YOUR_KEY_HERE]\";\n\n private static DocumentClient documentClient;\n\n public static DocumentClient getDocumentClient() {\n if (documentClient == null) {\n documentClient = new DocumentClient(HOST, MASTER_KEY,\n ConnectionPolicy.GetDefault(), ConsistencyLevel.Session);\n }\n\n return documentClient;\n }\n\n}\n","new_contents":"package com.microsoft.azure.documentdb.sample.dao;\n\nimport com.microsoft.azure.documentdb.ConnectionPolicy;\nimport com.microsoft.azure.documentdb.ConsistencyLevel;\nimport com.microsoft.azure.documentdb.DocumentClient;\n\npublic class DocumentClientFactory {\n private static final String HOST = \"https:\/\/docdb-java-sample.documents.azure.com:443\/\";\n private static final String MASTER_KEY = \"[YOUR_KEY_HERE]\";\n\n private static DocumentClient documentClient = new DocumentClient(HOST, MASTER_KEY,\n ConnectionPolicy.GetDefault(), ConsistencyLevel.Session);\n\n public static DocumentClient getDocumentClient() {\n return documentClient;\n }\n\n}\n","subject":"Load DocumentDB client at class-load time"} {"old_contents":"package com.fabiohideki.socialbooks.resources;\n\nimport java.util.List;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport com.fabiohideki.socialbooks.domain.Livro;\nimport com.fabiohideki.socialbooks.repository.LivrosRepository;\n\n@RestController\n@RequestMapping(\"\/livros\")\npublic class LivrosResources {\n\n\t@Autowired\n\tprivate LivrosRepository livrosRepository;\n\n\t@RequestMapping(method = RequestMethod.GET)\n\tpublic List listar() {\n\t\treturn livrosRepository.findAll();\n\t}\n\n\t@RequestMapping(method = RequestMethod.POST)\n\tpublic void salvar(@RequestBody Livro livro) {\n\t\tlivrosRepository.save(livro);\n\t}\n\n\t@RequestMapping(value = \"\/{id}\", method = RequestMethod.GET)\n\tpublic Livro buscar(@PathVariable Long id) {\n\t\treturn livrosRepository.findOne(id);\n\t}\n\n\t@RequestMapping(value = \"\/{id}\", method = RequestMethod.DELETE)\n\tpublic void deletar(@PathVariable Long id) {\n\t\tlivrosRepository.delete(id);\n\t}\n\n}\n","new_contents":"package com.fabiohideki.socialbooks.resources;\n\nimport java.util.List;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport com.fabiohideki.socialbooks.domain.Livro;\nimport com.fabiohideki.socialbooks.repository.LivrosRepository;\n\n@RestController\n@RequestMapping(\"\/livros\")\npublic class LivrosResources {\n\n\t@Autowired\n\tprivate LivrosRepository livrosRepository;\n\n\t@RequestMapping(method = RequestMethod.GET)\n\tpublic List listar() {\n\t\treturn livrosRepository.findAll();\n\t}\n\n\t@RequestMapping(method = RequestMethod.POST)\n\tpublic void salvar(@RequestBody Livro livro) {\n\t\tlivrosRepository.save(livro);\n\t}\n\n\t@RequestMapping(value = \"\/{id}\", method = RequestMethod.GET)\n\tpublic Livro buscar(@PathVariable(\"id\") Long id) {\n\t\treturn livrosRepository.findOne(id);\n\t}\n\n\t@RequestMapping(value = \"\/{id}\", method = RequestMethod.DELETE)\n\tpublic void deletar(@PathVariable(\"id\") Long id) {\n\t\tlivrosRepository.delete(id);\n\t}\n\n\t@RequestMapping(value = \"\/{id}\", method = RequestMethod.PUT)\n\tpublic void atualizar(@RequestBody Livro livro, @PathVariable(\"id\") Long id) {\n\t\tlivro.setId(id);\n\t\tlivrosRepository.save(livro);\n\t}\n\n}\n","subject":"PUT para atualizar o recurso Livro"} {"old_contents":"package edu.washington.escience.myriad;\n\n\/**\n * This class holds the constants for the Myria execution.\n * \n * @author dhalperi\n * \n *\/\npublic final class MyriaConstants {\n \/** Private constructor to disallow building utility class. *\/\n private MyriaConstants() {\n }\n\n \/** The identity of the master worker is current always zero. *\/\n public static final Integer MASTER_ID = Integer.valueOf(0);\n\n}\n","new_contents":"package edu.washington.escience.myriad;\n\n\/**\n * This class holds the constants for the Myria execution.\n * \n * @author dhalperi\n * \n *\/\npublic final class MyriaConstants {\n \/** Private constructor to disallow building utility class. *\/\n private MyriaConstants() {\n }\n\n \/** The identity of the master worker is current always zero. *\/\n public static final int MASTER_ID = 0;\n\n public static final String SYSTEM_NAME = \"Myria\";\n\n}\n","subject":"Move some more constants here"} {"old_contents":"package pokefenn.totemic.init;\n\nimport net.minecraft.tileentity.TileEntityType;\nimport net.minecraftforge.event.RegistryEvent;\nimport net.minecraftforge.eventbus.api.SubscribeEvent;\nimport net.minecraftforge.registries.ObjectHolder;\nimport pokefenn.totemic.Totemic;\nimport pokefenn.totemic.tile.totem.TileTotemBase;\n\n@ObjectHolder(Totemic.MOD_ID)\npublic final class ModTileEntities {\n public static final TileEntityType totem_base = null;\n\n @SubscribeEvent\n public static void init(RegistryEvent.Register> event) {\n event.getRegistry().registerAll(\n TileEntityType.Builder.create(TileTotemBase::new).build(null).setRegistryName(\"totem_base\")\n );\n }\n}\n","new_contents":"package pokefenn.totemic.init;\n\nimport net.minecraft.block.Block;\nimport net.minecraft.tileentity.TileEntityType;\nimport net.minecraftforge.event.RegistryEvent;\nimport net.minecraftforge.eventbus.api.SubscribeEvent;\nimport net.minecraftforge.registries.ObjectHolder;\nimport pokefenn.totemic.Totemic;\nimport pokefenn.totemic.tile.totem.TileTotemBase;\n\n@ObjectHolder(Totemic.MOD_ID)\npublic final class ModTileEntities {\n public static final TileEntityType totem_base = null;\n\n @SubscribeEvent\n public static void init(RegistryEvent.Register> event) {\n event.getRegistry().registerAll(\n TileEntityType.Builder.create(TileTotemBase::new, ModBlocks.getTotemBases().values().toArray(new Block[0])).build(null).setRegistryName(\"totem_base\")\n );\n }\n}\n","subject":"Fix invalid tile entity error"} {"old_contents":"package tutorial.storm.trident;\n\nimport backtype.storm.generated.DRPCExecutionException;\nimport backtype.storm.utils.DRPCClient;\nimport org.apache.thrift7.TException;\n\n\/**\n * @author Enno Shioji (eshioji@gmail.com)\n *\/\npublic class DrpcTestClient {\n public static void main(String[] args) throws TException, DRPCExecutionException {\n DRPCClient cl = new DRPCClient(\"localhost\",3772, 3000);\n System.out.println(cl.execute(\"ping\", \"ted\"));\n\n }\n}\n","new_contents":"package tutorial.storm.trident;\n\nimport backtype.storm.generated.DRPCExecutionException;\nimport backtype.storm.utils.DRPCClient;\nimport org.apache.thrift7.TException;\n\n\/**\n * @author Enno Shioji (eshioji@gmail.com)\n *\/\npublic class DrpcTestClient {\n public static void main(String[] args) throws TException, DRPCExecutionException {\n DRPCClient cl = new DRPCClient(\"localhost\",3772, 3000);\n if (args.length != 2){\n System.err.println(\" \");\n }else{\n String func = args[0];\n String argument = args[1];\n System.out.println(cl.execute(func, argument));\n }\n\n }\n}\n","subject":"Generalize the test DRPC client"} {"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\n\n@Version(\"2.3\")\npackage org.apache.sling.api.resource;\n\nimport aQute.bnd.annotation.Version;\n\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\n\n@Version(\"2.3.2\")\npackage org.apache.sling.api.resource;\n\nimport aQute.bnd.annotation.Version;\n\n","subject":"Update package version because of SLING-2844 and SLING-2845"} {"old_contents":"package com.nelsonjrodrigues.pchud.net;\n\nimport static java.lang.Byte.toUnsignedInt;\n\n\n\npublic class Extractor {\n\n private byte[] buffer;\n private int offset;\n private int length;\n\n public Extractor(byte[] buffer, int offset, int length) {\n this.buffer = buffer;\n this.offset = offset;\n this.length = length;\n }\n\n public int u8() {\n if (offset > length) {\n throw new ArrayIndexOutOfBoundsException();\n }\n return toUnsignedInt(buffer[offset++]);\n }\n\n public int u16() {\n return u8() ^\n u8() << 8;\n }\n\n public float f32() {\n return Float.intBitsToFloat(u8() ^\n u8() << 8 ^\n u8() << 16 ^\n u8() << 24);\n }\n\n}\n","new_contents":"package com.nelsonjrodrigues.pchud.net;\n\npublic class Extractor {\n\n private byte[] buffer;\n private int offset;\n private int length;\n\n public Extractor(byte[] buffer, int offset, int length) {\n this.buffer = buffer;\n this.offset = offset;\n this.length = length;\n }\n\n public int u8() {\n if (offset > length) {\n throw new ArrayIndexOutOfBoundsException();\n }\n return Byte.toUnsignedInt(buffer[offset++]);\n }\n\n public int u16() {\n return u8() ^\n u8() << 8;\n }\n\n public float f32() {\n return Float.intBitsToFloat(u8() ^\n u8() << 8 ^\n u8() << 16 ^\n u8() << 24);\n }\n\n}\n","subject":"Remove static import, code is more readable like this"} {"old_contents":"\/*\n * This file is provided to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n *\/\npackage com.basho.riak.client.raw.itest;\n\nimport java.io.IOException;\n\nimport com.basho.riak.client.http.Hosts;\nimport com.basho.riak.client.raw.RawClient;\nimport com.basho.riak.client.raw.http.HTTPClientConfig;\nimport com.basho.riak.client.raw.http.HTTPRiakClientFactory;\n\n\/**\n * @author russell\n * \n *\/\npublic class ITestHTTPClientAdapter extends ITestRawClientAdapter {\n\n \/*\n * (non-Javadoc)\n * \n * @see com.basho.riak.client.raw.itest.ITestRawClientAdapter#getClient()\n *\/\n @Override protected RawClient getClient() throws IOException {\n HTTPClientConfig config = new HTTPClientConfig.Builder().withHost(Hosts.RIAK_HOST).build();\n return HTTPRiakClientFactory.getInstance().newClient(config);\n }\n\n}\n","new_contents":"\/*\n * This file is provided to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n *\/\npackage com.basho.riak.client.raw.itest;\n\nimport java.io.IOException;\n\nimport com.basho.riak.client.http.Hosts;\nimport com.basho.riak.client.raw.RawClient;\nimport com.basho.riak.client.raw.http.HTTPClientConfig;\nimport com.basho.riak.client.raw.http.HTTPRiakClientFactory;\n\n\/**\n * @author russell\n * \n *\/\npublic class ITestHTTPClientAdapter extends ITestRawClientAdapter {\n\n \/*\n * (non-Javadoc)\n * \n * @see com.basho.riak.client.raw.itest.ITestRawClientAdapter#getClient()\n *\/\n @Override protected RawClient getClient() throws IOException {\n HTTPClientConfig config = new HTTPClientConfig.Builder().withUrl(Hosts.RIAK_URL).build();\n return HTTPRiakClientFactory.getInstance().newClient(config);\n }\n\n}\n","subject":"Add URL config to HTTP client adapter itest"} {"old_contents":"package com.cflint.plugins.core;\n\nimport ro.fortsoft.pf4j.Extension;\nimport cfml.parsing.cfscript.CFFunctionExpression;\nimport cfml.parsing.cfscript.script.CFAbortStatement;\nimport cfml.parsing.cfscript.script.CFExpressionStatement;\nimport cfml.parsing.cfscript.script.CFScriptStatement;\n\nimport com.cflint.BugInfo;\nimport com.cflint.BugList;\nimport com.cflint.plugins.CFLintScannerAdapter;\nimport com.cflint.plugins.Context;\n\n@Extension\npublic class AbortChecker extends CFLintScannerAdapter {\n\tfinal String severity = \"WARNING\";\n\n\tpublic void expression(final CFScriptStatement expression, final Context context, final BugList bugs) {\n\t\tSystem.out.println(expression.getClass().getName());\n\n\t\tif (expression instanceof CFAbortStatement) {\n\t\t\tint lineNo = ((CFAbortStatement) expression).getLine();\n\t\t\tbugs.add(new BugInfo.BugInfoBuilder().setLine(lineNo).setMessageCode(\"AVOID_USING_ABORT\")\n\t\t\t\t.setSeverity(severity).setFilename(context.getFilename())\n\t\t\t\t.setMessage(\"Abort statement at \" + lineNo + \". Avoid using abort in production code.\")\n\t\t\t\t.build());\n\t\t}\n\t}\n}","new_contents":"package com.cflint.plugins.core;\n\nimport ro.fortsoft.pf4j.Extension;\nimport cfml.parsing.cfscript.CFFunctionExpression;\nimport cfml.parsing.cfscript.script.CFAbortStatement;\nimport cfml.parsing.cfscript.script.CFExpressionStatement;\nimport cfml.parsing.cfscript.script.CFScriptStatement;\n\nimport com.cflint.BugInfo;\nimport com.cflint.BugList;\nimport com.cflint.plugins.CFLintScannerAdapter;\nimport com.cflint.plugins.Context;\n\n@Extension\npublic class AbortChecker extends CFLintScannerAdapter {\n\tfinal String severity = \"WARNING\";\n\t\n\t@Override\n\tpublic void expression(final CFScriptStatement expression, final Context context, final BugList bugs) {\n\t\tif (expression instanceof CFAbortStatement) {\n\t\t\tint lineNo = ((CFAbortStatement) expression).getLine() + context.startLine() - 1;\n\t\t\tbugs.add(new BugInfo.BugInfoBuilder().setLine(lineNo).setMessageCode(\"AVOID_USING_ABORT\")\n\t\t\t\t.setSeverity(severity).setFilename(context.getFilename())\n\t\t\t\t.setMessage(\"Abort statement at line \" + lineNo + \". Avoid using abort in production code.\")\n\t\t\t\t.build());\n\t\t}\n\t}\n}","subject":"Remove debug and fix line number"} {"old_contents":"package org.recap.route;\n\nimport org.apache.camel.Exchange;\nimport org.apache.camel.Processor;\nimport org.apache.camel.impl.DefaultMessage;\nimport org.recap.model.jpa.ReportEntity;\nimport org.recap.repository.ReportDetailRepository;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\nimport org.springframework.util.CollectionUtils;\n\nimport java.util.List;\n\n\/**\n * Created by peris on 8\/20\/16.\n *\/\n@Component\npublic class XMLFileLoadValidator implements Processor {\n\n @Autowired\n ReportDetailRepository reportDetailRepository;\n\n @Override\n public void process(Exchange exchange) throws Exception {\n String camelFileName = (String) exchange.getIn().getHeader(\"CamelFileName\");\n\n List reportEntity =\n reportDetailRepository.findByFileName(camelFileName);\n\n if(!CollectionUtils.isEmpty(reportEntity)){\n DefaultMessage defaultMessage = new DefaultMessage();\n defaultMessage.setBody(\"\");\n exchange.setIn(defaultMessage);\n exchange.setOut(defaultMessage);\n }\n }\n}\n","new_contents":"package org.recap.route;\n\nimport org.apache.camel.Exchange;\nimport org.apache.camel.Processor;\nimport org.apache.camel.impl.DefaultMessage;\nimport org.recap.model.jpa.ReportEntity;\nimport org.recap.repository.ReportDetailRepository;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\nimport org.springframework.util.CollectionUtils;\n\nimport java.util.List;\n\n\/**\n * Created by peris on 8\/20\/16.\n *\/\n@Component\npublic class XMLFileLoadValidator implements Processor {\n\n @Autowired\n ReportDetailRepository reportDetailRepository;\n\n \/**\n * Check to see if the xml file has been loaded already. If so, set empty body such that the file doesn't get\n * processed again.\n * @param exchange\n * @throws Exception\n *\/\n @Override\n public void process(Exchange exchange) throws Exception {\n String camelFileName = (String) exchange.getIn().getHeader(\"CamelFileName\");\n\n List reportEntity =\n reportDetailRepository.findByFileName(camelFileName);\n\n if(!CollectionUtils.isEmpty(reportEntity)){\n DefaultMessage defaultMessage = new DefaultMessage();\n defaultMessage.setBody(\"\");\n exchange.setIn(defaultMessage);\n exchange.setOut(defaultMessage);\n }\n }\n}\n","subject":"Check to validated xml file has been loaded already; if so, dont load it again."} {"old_contents":"package Functions;\nimport javax.swing.*;\nimport javax.swing.border.*;\n\nimport Elements.Element;\n\nimport java.awt.*;\n\npublic class ElementPanel extends JPanel \n{\n\tprivate Element element;\n\t\n\tpublic ElementPanel(Element element)\n\t{\n\t\tthis.element = element;\n\t\tif(element != null)\n\t\t{\n\t\t\tString name = element.getSymbol();\n\t\t\tif(element.getName().equals(\"Lanthanum\"))\n\t\t\t{\n\t\t\t\tname = \"*\" + name;\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Barium\"))\n\t\t\t{\n\t\t\t\tname += \"*\";\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Actinium\"))\n\t\t\t{\n\t\t\t\tname = \"**\" + name;\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Radium\"))\n\t\t\t{\n\t\t\t\tname += \"**\";\n\t\t\t}\n\t\t\t\n\t\t\tadd(new JLabel(name));\n\t\t\tsetBorder(new CompoundBorder(new LineBorder(Color.BLACK, 1), new EmptyBorder(6, 6, 6, 6)));\n\t\t}\n\t}\n\t\n\tpublic Element getElement()\n\t{\n\t\treturn element;\n\t}\n}\n","new_contents":"package Functions;\nimport javax.swing.*;\nimport javax.swing.border.*;\n\nimport Elements.Element;\n\nimport java.awt.*;\n\npublic class ElementPanel extends JPanel \n{\n\tprivate Element element;\n\t\n\tpublic ElementPanel(Element element)\n\t{\n\t\tthis.element = element;\n\t\tif(element != null)\n\t\t{\n\t\t\tString name = element.getSymbol();\n\t\t\tif(element.getName().equals(\"Lanthanum\"))\n\t\t\t{\n\t\t\t\tname = \"*\" + name;\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Barium\"))\n\t\t\t{\n\t\t\t\tname += \"*\";\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Actinium\"))\n\t\t\t{\n\t\t\t\tname = \"**\" + name;\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Radium\"))\n\t\t\t{\n\t\t\t\tname += \"**\";\n\t\t\t}\n\t\t\t\n\t\t\tthis.setLayout(new GridBagLayout());\n\t\t\tGridBagConstraints c = new GridBagConstraints();\n\t\t\tc.ipady = -5;\n\t\t\tc.gridy = 0;\n\t\t\tadd(new JLabel(\"\" + element.getNum()), c);\n\n\t\t\tc.gridy = 1;\n\t\t\tadd(new JLabel(\"

\" + name + \"<\/h3><\/html>\"), c);\n\t\t\t\n\t\t\tc.gridy = 2;\n\t\t\tc.ipady = 0;\n\t\t\tadd(new JLabel(\"\" + element.getName() + \"<\/font><\/html>\"), c);\n\t\t\t\n\t\t\tsetBorder(new CompoundBorder(new LineBorder(Color.BLACK, 1), new EmptyBorder(3, 3, 3, 3)));\n\t\t\t\n\t\t\t\/*add(new JLabel(\"\" + element.getNum() + \"

\" + name + \"<\/h1>
\" + element.getName() + \"<\/center><\/html>\"));\n\t\t\tsetBorder(new CompoundBorder(new LineBorder(Color.BLACK, 1), new EmptyBorder(6, 6, 6, 6)));\n\t\t\tsetSize(50, 50);*\/\n\t\t}\n\t}\n\t\n\tpublic Element getElement()\n\t{\n\t\treturn element;\n\t}\n}\n","subject":"Revert \"Revert \"Made the periodic table different\"\""} {"old_contents":"package android.org.json;\n\nimport com.google.gwt.json.client.JSONParser;\n\n\/**\n * Proxy to the GWT class\n *\/\npublic class JSONObject {\n\n\tcom.google.gwt.json.client.JSONObject jsonObject;\n\n\tpublic JSONObject(String json) {\n\t\tjsonObject = JSONParser.parseStrict(json).isObject();\n\t}\n\n\tpublic String getString(String name) {\n\t\treturn jsonObject.get(name).toString();\n\t}\n\n\tpublic int getInt(String name) {\n\t\treturn Integer.valueOf(jsonObject.get(name).toString());\n\t}\n}\n","new_contents":"package android.org.json;\n\nimport com.google.gwt.json.client.JSONParser;\n\n\/**\n * Proxy to the GWT class\n *\/\npublic class JSONObject {\n\n\tcom.google.gwt.json.client.JSONObject jsonObject;\n\n\tpublic JSONObject(String json) {\n\t\tjsonObject = JSONParser.parseStrict(json).isObject();\n\t}\n\n\tpublic String getString(String name) {\n\t\treturn jsonObject.get(name).toString().replaceAll(\"^\\\"|\\\"$\", \"\");\n\t}\n\n\tpublic int getInt(String name) {\n\t\treturn Integer.valueOf(jsonObject.get(name).toString().replaceAll(\"^\\\"|\\\"$\", \"\"));\n\t}\n}\n","subject":"Remove quotation marks from JSON objects"} {"old_contents":"package org.jtrim2.build;\n\nimport java.io.IOException;\nimport org.gradle.api.Project;\n\nimport static org.jtrim2.build.BuildFileUtils.*;\n\npublic final class Versions {\n private static final String GROUP_NAME = \"org.jtrim2\";\n\n private static final String VERSION_BASE_PROPERTY = \"versionBase\";\n\n public static void setVersion(Project project) throws IOException {\n String suffix = ReleaseUtils.isRelease(project) ? \"\" : \"-SNAPSHOT\";\n\n String versionBase = readTextFile(rootPath(project, \"version.txt\")).trim();\n project.getExtensions().add(VERSION_BASE_PROPERTY, versionBase);\n\n project.setGroup(GROUP_NAME);\n project.setVersion(versionBase + suffix);\n }\n\n public static String getVersion(Project project) {\n Object version = project.getVersion();\n return version != null ? version.toString() : null;\n }\n\n public static String getVersionBase(Project project) {\n return ProjectUtils.getStringProperty(project, VERSION_BASE_PROPERTY, \"\");\n }\n\n private Versions() {\n throw new AssertionError();\n }\n}\n","new_contents":"package org.jtrim2.build;\n\nimport java.io.IOException;\nimport org.gradle.api.Project;\n\nimport static org.jtrim2.build.BuildFileUtils.*;\n\npublic final class Versions {\n private static final String GROUP_NAME = \"org.jtrim2\";\n\n private static final String VERSION_BASE_PROPERTY = \"versionBase\";\n private static final String VERSION_SUFFIX_PROPERTY = \"versionSuffix\";\n\n public static void setVersion(Project project) throws IOException {\n String versionBase = readTextFile(rootPath(project, \"version.txt\")).trim();\n project.getExtensions().add(VERSION_BASE_PROPERTY, versionBase);\n\n project.setGroup(GROUP_NAME);\n project.setVersion(versionBase + getVersionSuffix(project));\n }\n\n private static String getVersionSuffix(Project project) {\n boolean release = ReleaseUtils.isRelease(project);\n\n String defaultSuffix = release ? \"\" : \"SNAPSHOT\";\n String suffix = ProjectUtils.getStringProperty(project, VERSION_SUFFIX_PROPERTY, defaultSuffix);\n return suffix.isEmpty()\n ? \"\"\n : \"-\" + suffix;\n }\n\n public static String getVersion(Project project) {\n Object version = project.getVersion();\n return version != null ? version.toString() : null;\n }\n\n public static String getVersionBase(Project project) {\n return ProjectUtils.getStringProperty(project, VERSION_BASE_PROPERTY, \"\");\n }\n\n private Versions() {\n throw new AssertionError();\n }\n}\n","subject":"Build now allows to specify custom version suffix."} {"old_contents":"import java.util.*;\n\npublic class Solution {\n public int jump(int[] jumps) {\n if (jumps.length == 0) return 0;\n\n int lastIndex = jumps.length - 1;\n boolean[] visited = new boolean[jumps.length];\n LinkedList queue = new LinkedList();\n queue.add(0);\n int stepCount = 0;\n visited[0] = true;\n\n while (!queue.isEmpty()) {\n int queueSize = queue.size();\n for (int i = 0; i < queueSize; i++) {\n int index = queue.removeFirst();\n if (index == lastIndex) {\n return stepCount;\n }\n\n int maxJump = jumps[index];\n for (int jump = 1; jump <= maxJump; jump++) {\n int newIndex = index + jump;\n if (newIndex >= jumps.length) {\n break;\n }\n if (!visited[newIndex]) {\n visited[newIndex] = true;\n queue.addLast(newIndex);\n }\n }\n }\n\n stepCount++;\n }\n\n return stepCount;\n }\n}\n","new_contents":"import java.util.*;\n\npublic class Solution {\n public int jump(int[] jumps) {\n if (jumps.length == 0) return 0;\n if (jumps.length == 1) return 0;\n\n int lastIndex = jumps.length - 1;\n boolean[] visited = new boolean[jumps.length];\n LinkedList queue = new LinkedList();\n queue.add(0);\n int stepCount = 0;\n visited[0] = true;\n\n while (!queue.isEmpty()) {\n int queueSize = queue.size();\n for (int i = 0; i < queueSize; i++) {\n int index = queue.removeFirst();\n int maxIndex = Math.min(index + jumps[index], lastIndex);\n if (maxIndex == lastIndex) {\n return stepCount + 1;\n }\n\n for (int newIndex = maxIndex; newIndex > index; newIndex--) {\n if (visited[newIndex]) break;\n\n visited[newIndex] = true;\n queue.addLast(newIndex);\n }\n }\n\n stepCount++;\n }\n\n return stepCount;\n }\n}\n","subject":"Optimize jump game ii solution"} {"old_contents":"package bj.pranie.controller;\n\nimport bj.pranie.util.TimeUtil;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.ui.Model;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport java.util.Calendar;\n\n\/**\n * Created by Sebastian Sokolowski on 12.10.16.\n *\/\n\n@Controller\npublic class IndexController {\n private final Logger log = LoggerFactory.getLogger(this.getClass());\n\n @RequestMapping(value = \"\/\", method = RequestMethod.GET)\n public ModelAndView index(Model model) {\n ModelAndView modelAndView = new ModelAndView(\"index\");\n modelAndView.addObject(\"time\", TimeUtil.getTime());\n log.debug(\"time\" + Calendar.getInstance().getTime().toString());\n\n return modelAndView;\n }\n}\n","new_contents":"package bj.pranie.controller;\n\nimport bj.pranie.entity.User;\nimport org.springframework.security.core.Authentication;\nimport org.springframework.security.core.context.SecurityContextHolder;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\n\n\/**\n * Created by Sebastian Sokolowski on 12.10.16.\n *\/\n\n@Controller\npublic class IndexController {\n\n @RequestMapping(value = \"\/\", method = RequestMethod.GET)\n public String index() {\n if (isAuthenticatedUser()) {\n return \"redirect:\/week\";\n }\n return \"index\";\n }\n\n private boolean isAuthenticatedUser() {\n Authentication authentication = SecurityContextHolder.getContext().getAuthentication();\n if (authentication.getPrincipal() instanceof User) {\n return true;\n }\n return false;\n }\n}\n","subject":"Implement auto redirect authenticated user to week page."} {"old_contents":"package no.stelar7.api.r4j.pojo.val.matchlist;\n\nimport java.io.Serializable;\nimport java.util.Objects;\n\npublic class MatchReference implements Serializable\n{\n private static final long serialVersionUID = -5301457261872587385L;\n \n private String matchId;\n private Long gameStartTime;\n private String teamId;\n \n public String getMatchId()\n {\n return matchId;\n }\n \n public Long getGameStartTime()\n {\n return gameStartTime;\n }\n \n public String getTeamId()\n {\n return teamId;\n }\n \n @Override\n public boolean equals(Object o)\n {\n if (this == o)\n {\n return true;\n }\n if (o == null || getClass() != o.getClass())\n {\n return false;\n }\n MatchReference match = (MatchReference) o;\n return Objects.equals(matchId, match.matchId) &&\n Objects.equals(gameStartTime, match.gameStartTime) &&\n Objects.equals(teamId, match.teamId);\n }\n \n @Override\n public int hashCode()\n {\n return Objects.hash(matchId, gameStartTime, teamId);\n }\n \n @Override\n public String toString()\n {\n return \"Match{\" +\n \"matchId='\" + matchId + '\\'' +\n \", gameStartTime=\" + gameStartTime +\n \", teamId='\" + teamId + '\\'' +\n '}';\n }\n}\n","new_contents":"package no.stelar7.api.r4j.pojo.val.matchlist;\n\nimport java.io.Serializable;\nimport java.util.Objects;\n\npublic class MatchReference implements Serializable\n{\n private static final long serialVersionUID = -5301457261872587385L;\n\n private String matchId;\n private Long gameStartTimeMillis;\n private String queueId;\n\n public String getMatchId()\n {\n return matchId;\n }\n\n public Long getGameStartTimeMillis()\n {\n return gameStartTimeMillis;\n }\n\n public String getQueueId()\n {\n return queueId;\n }\n\n @Override\n public boolean equals(Object o)\n {\n if (this == o)\n {\n return true;\n }\n if (o == null || getClass() != o.getClass())\n {\n return false;\n }\n MatchReference match = (MatchReference) o;\n return Objects.equals(matchId, match.matchId) &&\n Objects.equals(gameStartTimeMillis, match.gameStartTimeMillis) &&\n Objects.equals(queueId, match.queueId);\n }\n\n @Override\n public int hashCode()\n {\n return Objects.hash(matchId, gameStartTimeMillis, queueId);\n }\n\n @Override\n public String toString()\n {\n return \"Match{\" +\n \"matchId='\" + matchId + '\\'' +\n \", gameStartTimeMillis=\" + gameStartTimeMillis +\n \", queueId='\" + queueId + '\\'' +\n '}';\n }\n}\n","subject":"Fix property names to be related to response from riot valorant api"} {"old_contents":"package com.tobi.movies;\n\nimport android.support.annotation.IdRes;\nimport android.support.test.espresso.contrib.RecyclerViewActions;\n\nimport static android.support.test.espresso.Espresso.onView;\nimport static android.support.test.espresso.action.ViewActions.click;\nimport static android.support.test.espresso.assertion.ViewAssertions.matches;\nimport static android.support.test.espresso.matcher.ViewMatchers.*;\nimport static org.hamcrest.core.AllOf.allOf;\n\npublic abstract class Robot {\n\n protected T checkTextIsDisplayed(String text, @IdRes int view) {\n onView(allOf(withId(view), withText(text))).check(matches(isDisplayed()));\n return (T) this;\n }\n\n protected T selectPositionInRecyclerView(int position, @IdRes int recyclerView) {\n onView(withId(recyclerView))\n .perform(RecyclerViewActions.actionOnItemAtPosition(position, click()));\n return (T) this;\n }\n\n public K toRobot(Class robotClass) throws IllegalAccessException, InstantiationException {\n return robotClass.newInstance();\n }\n}\n","new_contents":"package com.tobi.movies;\n\nimport android.support.annotation.IdRes;\nimport android.support.test.espresso.contrib.RecyclerViewActions;\n\nimport static android.support.test.espresso.Espresso.onView;\nimport static android.support.test.espresso.action.ViewActions.click;\nimport static android.support.test.espresso.assertion.ViewAssertions.matches;\nimport static android.support.test.espresso.matcher.ViewMatchers.*;\nimport static org.hamcrest.core.AllOf.allOf;\n\npublic abstract class Robot {\n\n protected T checkTextIsDisplayed(String text, @IdRes int view) {\n onView(allOf(withId(view), withText(text))).check(matches(isDisplayed()));\n return (T) this;\n }\n\n protected T selectPositionInRecyclerView(int position, @IdRes int recyclerView) {\n onView(withId(recyclerView))\n .perform(RecyclerViewActions.actionOnItemAtPosition(position, click()));\n return (T) this;\n }\n\n public T waitFor(int seconds) throws InterruptedException {\n Thread.sleep(seconds * 1000);\n return (T) this;\n }\n\n\n public K toRobot(Class robotClass) throws IllegalAccessException, InstantiationException {\n return robotClass.newInstance();\n }\n}\n","subject":"Add sleep method to robot"} {"old_contents":"package com.box.l10n.mojito.aws.s3;\n\nimport com.amazonaws.auth.AWSCredentials;\nimport com.amazonaws.auth.AWSStaticCredentialsProvider;\nimport com.amazonaws.auth.BasicAWSCredentials;\nimport com.amazonaws.regions.Regions;\nimport com.amazonaws.services.s3.AmazonS3;\nimport com.amazonaws.services.s3.AmazonS3ClientBuilder;\nimport org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\n@ConditionalOnProperty(\"l10n.aws.s3.enabled\")\npublic class AmazonS3Configuration {\n\n @Bean\n public AmazonS3 amazonS3Client(AmazonS3ConfigurationProperties amazonS3ConfigurationProperties) {\n AmazonS3ClientBuilder amazonS3ClientBuilder = AmazonS3ClientBuilder\n .standard()\n .withRegion(Regions.fromName(amazonS3ConfigurationProperties.getRegion()));\n\n if (amazonS3ConfigurationProperties.getAccessKeyId() != null) {\n AWSCredentials credentials = new BasicAWSCredentials(amazonS3ConfigurationProperties.getAccessKeyId(), amazonS3ConfigurationProperties.getAccessKeySecret());\n amazonS3ClientBuilder.withCredentials(new AWSStaticCredentialsProvider(credentials));\n }\n\n AmazonS3 amazonS3 = amazonS3ClientBuilder.build();\n return amazonS3;\n }\n}\n","new_contents":"package com.box.l10n.mojito.aws.s3;\n\nimport com.amazonaws.PredefinedClientConfigurations;\nimport com.amazonaws.auth.AWSCredentials;\nimport com.amazonaws.auth.AWSStaticCredentialsProvider;\nimport com.amazonaws.auth.BasicAWSCredentials;\nimport com.amazonaws.regions.Regions;\nimport com.amazonaws.services.s3.AmazonS3;\nimport com.amazonaws.services.s3.AmazonS3ClientBuilder;\nimport org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\n@ConditionalOnProperty(\"l10n.aws.s3.enabled\")\npublic class AmazonS3Configuration {\n\n @Bean\n public AmazonS3 amazonS3Client(AmazonS3ConfigurationProperties amazonS3ConfigurationProperties) {\n AmazonS3ClientBuilder amazonS3ClientBuilder = AmazonS3ClientBuilder\n .standard()\n .withClientConfiguration(PredefinedClientConfigurations.defaultConfig().withGzip(true))\n .withRegion(Regions.fromName(amazonS3ConfigurationProperties.getRegion()));\n\n if (amazonS3ConfigurationProperties.getAccessKeyId() != null) {\n AWSCredentials credentials = new BasicAWSCredentials(amazonS3ConfigurationProperties.getAccessKeyId(), amazonS3ConfigurationProperties.getAccessKeySecret());\n amazonS3ClientBuilder.withCredentials(new AWSStaticCredentialsProvider(credentials));\n }\n\n AmazonS3 amazonS3 = amazonS3ClientBuilder.build();\n return amazonS3;\n }\n}\n","subject":"Use GZip compression in the Amazon S3 client to speed up large object transfer"} {"old_contents":"package com.github.aureliano.edocs.app.gui;\n\nimport java.awt.BorderLayout;\nimport java.awt.Dimension;\n\nimport javax.swing.JFrame;\nimport javax.swing.JPanel;\n\nimport com.github.aureliano.edocs.app.gui.menu.MenuBar;\n\npublic class AppFrame extends JFrame {\n\n\tprivate static final long serialVersionUID = 7618501026967569839L;\n\n\tpublic AppFrame() {\n\t\tthis.buildGui();\n\t}\n\t\n\tprivate void buildGui() {\n\t\tsuper.setTitle(\"e-Docs\");\n\t\tsuper.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tJPanel panel = new JPanel(new BorderLayout());\n\t\tpanel.setOpaque(true);\n\t\tpanel.add(new VerticalToolBar(), BorderLayout.WEST);\n\t\t\n\t\tsuper.setContentPane(panel);\n\t\tsuper.setJMenuBar(new MenuBar());\n\t}\n\t\n\tpublic void showFrame() {\n\t\tsuper.pack();\n\t\tsuper.setVisible(true);\n\t\tsuper.setSize(new Dimension(500, 500));\n\t}\n}","new_contents":"package com.github.aureliano.edocs.app.gui;\n\nimport java.awt.BorderLayout;\nimport java.awt.Dimension;\n\nimport javax.swing.JFrame;\nimport javax.swing.JPanel;\n\nimport com.github.aureliano.edocs.app.gui.menu.MenuBar;\n\npublic class AppFrame extends JFrame {\n\n\tprivate static final long serialVersionUID = 7618501026967569839L;\n\n\tprivate TabbedPane tabbedPane;\n\t\n\tpublic AppFrame() {\n\t\tthis.buildGui();\n\t}\n\t\n\tprivate void buildGui() {\n\t\tsuper.setTitle(\"e-Docs\");\n\t\tsuper.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tJPanel panel = new JPanel(new BorderLayout());\n\t\tpanel.setOpaque(true);\n\t\tpanel.add(new VerticalToolBar(), BorderLayout.WEST);\n\t\t\n\t\tthis.tabbedPane = new TabbedPane();\n\t\tpanel.add(this.tabbedPane, BorderLayout.CENTER);\n\t\t\n\t\tsuper.setContentPane(panel);\n\t\tsuper.setJMenuBar(new MenuBar());\n\t}\n\t\n\tpublic void showFrame() {\n\t\tsuper.pack();\n\t\tsuper.setVisible(true);\n\t\tsuper.setSize(new Dimension(500, 500));\n\t}\n}","subject":"Add tabbed pane to the center of the frame."} {"old_contents":"package com.phonegap.device;\n\nimport net.rim.device.api.script.Scriptable;\nimport net.rim.device.api.system.DeviceInfo;\n\npublic final class DeviceFeature extends Scriptable {\n\tpublic static final String FIELD_PLATFORM = \"platform\";\n\tpublic static final String FIELD_UUID = \"uuid\";\n\tpublic static final String FIELD_PHONEGAP = \"phonegap\";\n\t\n\tpublic Object getField(String name) throws Exception {\n\t\t\n\t\tif (name.equals(FIELD_PLATFORM)) {\n\t\t\treturn new String(DeviceInfo.getPlatformVersion());\n\t\t}\n\t\telse if (name.equals(FIELD_UUID)) {\n\t\t\treturn new Integer(DeviceInfo.getDeviceId());\n\t\t}\n\t\telse if (name.equals(FIELD_PHONEGAP)) {\n\t\t\treturn \"pre-0.92 EDGE\";\n\t\t}\n\t\t\n\t\treturn super.getField(name);\n\t}\n}\n\n\n\n\n\n\n","new_contents":"\/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http:\/\/opensource.org\/licenses\/alphabetical for full text.\n * \n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010, IBM Corporation\n *\/\npackage com.phonegap.device;\n\nimport net.rim.device.api.script.Scriptable;\nimport net.rim.device.api.system.DeviceInfo;\n\n\/**\n * PhoneGap plugin that provides device information, including:\n * \n * - Device platform version (e.g. 2.13.0.95). Not to be confused with BlackBerry OS version.\n * - Unique device identifier (UUID).\n * - PhoneGap software version.\n *\/\npublic final class DeviceFeature extends Scriptable {\n\tpublic static final String FIELD_PLATFORM = \"platform\";\n\tpublic static final String FIELD_UUID = \"uuid\";\n\tpublic static final String FIELD_PHONEGAP = \"phonegap\";\n\t\n\tpublic Object getField(String name) throws Exception {\n\t\t\n\t\tif (name.equals(FIELD_PLATFORM)) {\n\t\t\treturn new String(DeviceInfo.getPlatformVersion());\n\t\t}\n\t\telse if (name.equals(FIELD_UUID)) {\n\t\t\treturn new Integer(DeviceInfo.getDeviceId());\n\t\t}\n\t\telse if (name.equals(FIELD_PHONEGAP)) {\n\t\t\treturn \"0.9.2\";\n\t\t}\n\t\t\n\t\treturn super.getField(name);\n\t}\n}\n","subject":"Change PhoneGap version to '0.9.2'."} {"old_contents":"package ru.job4j.array;\n\n\/**\n* Class BubbpleSort ti sort some arrays.\n* @author Eugene Lazarev mailto(helycopternicht@rambler.ru)\n* @since 27.03.2017\n*\/\npublic class BubbleSort {\n\t\/**\n\t* Method returns sorted array.\n\t* @param source - source array\n\t* @return sorded source array\n\t*\/\n\tpublic int[] sort(int[] source) {\n\t\tboolean sorted = false;\n\t\tint intend = 0;\n\t\twhile (!sorted) {\n\t\t\tsorted = true;\n\t\t\tfor (int i = 1; i < source.length; i++) {\n\t\t\t\tif (source[i - 1] > source[i]) {\n\t\t\t\t\tint temp = source[i - 1];\n\t\t\t\t\tsource[i - 1] = source[i];\n\t\t\t\t\tsource[i] = temp;\n\t\t\t\t\tsorted = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tintend++;\n\t\t}\n\t\treturn source;\n\t}\n}","new_contents":"package ru.job4j.array;\n\n\/**\n* Class BubbpleSort ti sort some arrays.\n* @author Eugene Lazarev mailto(helycopternicht@rambler.ru)\n* @since 27.03.2017\n*\/\npublic class BubbleSort {\n\t\/**\n\t* Method returns sorted array.\n\t* @param source - source array\n\t* @return sorded source array\n\t*\/\n\tpublic int[] sort(int[] source) {\n\t\tboolean sorted = false;\n\t\tint intend = 0;\n\t\twhile (!sorted) {\n\t\t\tsorted = true;\n\t\t\tfor (int i = 1; i < source.length - intend; i++) {\n\t\t\t\tif (source[i - 1] > source[i]) {\n\t\t\t\t\tint temp = source[i - 1];\n\t\t\t\t\tsource[i - 1] = source[i];\n\t\t\t\t\tsource[i] = temp;\n\t\t\t\t\tsorted = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tintend++;\n\t\t}\n\t\treturn source;\n\t}\n}","subject":"Fix unused variable in BubbpleSort class"} {"old_contents":"package com.cisco.trex.stateless.model.capture;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class CaptureMonitor {\n \n @JsonProperty(\"capture_id\")\n private int captureId;\n\n @JsonProperty(\"start_ts\")\n private long startTs;\n\n @JsonProperty(\"capture_id\")\n public int getcaptureId() {\n return captureId;\n }\n\n @JsonProperty(\"capture_id\")\n public void setcaptureId(int captureId) {\n this.captureId = captureId;\n }\n}\n","new_contents":"package com.cisco.trex.stateless.model.capture;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class CaptureMonitor {\n \n @JsonProperty(\"capture_id\")\n private int captureId;\n\n @JsonProperty(\"start_ts\")\n private long startTs;\n\n @JsonProperty(\"capture_id\")\n public int getCaptureId() {\n return captureId;\n }\n\n @JsonProperty(\"capture_id\")\n public void setCaptureId(int captureId) {\n this.captureId = captureId;\n }\n\n @JsonProperty(\"start_ts\")\n public long getStartTimeStamp() {\n return startTs;\n }\n\n @JsonProperty(\"start_ts\")\n public void setStartTimeStamp(long startTs) {\n this.startTs = startTs;\n }\n}\n","subject":"Add getter and setter for start_ts field."} {"old_contents":"package es.shyri.longoperationservice;\n\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.Binder;\nimport android.os.IBinder;\nimport android.support.annotation.Nullable;\n\n\/**\n * Created by Shyri on 01\/02\/2016.\n *\/\npublic class LongOperationService extends Service {\n\n private final IBinder mBinder = new LocalBinder();\n\n @Nullable\n @Override\n public IBinder onBind(Intent intent) {\n return mBinder;\n }\n }\n\n \/**\n * Class used for the client Binder. Because we know this service always\n * runs in the same process as its clients, we don't need to deal with IPC.\n *\/\n public class LocalBinder extends Binder {\n public LongOperationService getService() {\n \/\/ Return this instance of LocalService so clients can call public methods\n return LongOperationService.this;\n }\n }\n}\n","new_contents":"package es.shyri.longoperationservice;\n\nimport android.app.NotificationManager;\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.Binder;\nimport android.os.IBinder;\nimport android.support.annotation.Nullable;\nimport android.support.v7.app.NotificationCompat;\n\n\/**\n * Created by Shyri on 01\/02\/2016.\n *\/\npublic class LongOperationService extends Service {\n public static final int NOTIFICATION_ID = 1234;\n private NotificationManager nm;\n\n private final IBinder mBinder = new LocalBinder();\n\n public void onCreate() {\n super.onCreate();\n nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n }\n\n @Nullable\n @Override\n public IBinder onBind(Intent intent) {\n return mBinder;\n }\n }\n\n \/**\n * Class used for the client Binder. Because we know this service always\n * runs in the same process as its clients, we don't need to deal with IPC.\n *\/\n public class LocalBinder extends Binder {\n public LongOperationService getService() {\n \/\/ Return this instance of LocalService so clients can call public methods\n return LongOperationService.this;\n }\n }\n}\n","subject":"Add notification manager to service"} {"old_contents":"package app.android.gambit.remote;\n\n\nimport java.util.Date;\n\nimport android.text.format.Time;\n\n\npublic class InternetDateTime\n{\n\tprivate Time time;\n\n\tpublic InternetDateTime() {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.setToNow();\n\t}\n\n\tpublic InternetDateTime(String dateTimeAsString) {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.parse3339(dateTimeAsString);\n\t}\n\n\tpublic InternetDateTime(Date dateTimeAsUtcDate) {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.set(dateTimeAsUtcDate.getTime());\n\t}\n\n\t@Override\n\tpublic String toString() {\n\t\treturn time.format3339(false);\n\t}\n\n\tpublic Date toDate() {\n\t\treturn new Date(time.toMillis(false));\n\t}\n\n\tpublic boolean isAfter(InternetDateTime dateTime) {\n\t\treturn time.after(dateTime.time);\n\t}\n\n\tpublic boolean isBefore(InternetDateTime dateTime) {\n\t\treturn time.before(dateTime.time);\n\t}\n}\n","new_contents":"package app.android.gambit.remote;\n\n\nimport java.util.Date;\n\nimport android.text.format.Time;\n\n\npublic class InternetDateTime\n{\n\tprivate final Time time;\n\n\tpublic InternetDateTime() {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.setToNow();\n\t}\n\n\tpublic InternetDateTime(String dateTimeAsString) {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.parse3339(dateTimeAsString);\n\t}\n\n\tpublic InternetDateTime(Date dateTimeAsUtcDate) {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.set(dateTimeAsUtcDate.getTime());\n\t}\n\n\t@Override\n\tpublic String toString() {\n\t\treturn time.format3339(false);\n\t}\n\n\tpublic Date toDate() {\n\t\treturn new Date(time.toMillis(false));\n\t}\n\n\tpublic boolean isAfter(InternetDateTime dateTime) {\n\t\treturn time.after(dateTime.time);\n\t}\n\n\tpublic boolean isBefore(InternetDateTime dateTime) {\n\t\treturn time.before(dateTime.time);\n\t}\n}\n","subject":"Add final modifier to internet date-time field."} {"old_contents":"package org.rocket.network.props;\n\nimport org.rocket.network.MutProp;\nimport org.rocket.network.NetworkClient;\nimport org.rocket.network.PropId;\nimport org.rocket.network.PropValidator;\n\npublic class PropPresenceValidator implements PropValidator {\n private final PropId pid;\n\n public PropPresenceValidator(PropPresence annotation) {\n this.pid = PropIds.type(annotation.value());\n }\n\n @Override\n public void validate(NetworkClient client) {\n MutProp prop = client.getProp(pid);\n\n if (!prop.isDefined()) {\n throw new AssertionError(String.format(\n \"Prop %s must have a value\",\n prop.getId()));\n }\n }\n}\n","new_contents":"package org.rocket.network.props;\n\nimport org.rocket.network.MutProp;\nimport org.rocket.network.NetworkClient;\nimport org.rocket.network.PropId;\nimport org.rocket.network.PropValidator;\n\npublic class PropPresenceValidator implements PropValidator {\n private final PropId pid;\n private String messageError;\n\n public PropPresenceValidator(PropPresence annotation) {\n this.pid = PropIds.type(annotation.value());\n this.messageError = String.format(\n \"Prop %s must have a value\", pid);\n }\n\n @Override\n public void validate(NetworkClient client) {\n MutProp prop = client.getProp(pid);\n\n if (!prop.isDefined()) {\n throw new AssertionError(messageError);\n }\n }\n}\n","subject":"Build the error message earlier"} {"old_contents":"package com.malpo.sliver.sample.ui.number;\n\nimport com.malpo.sliver.sample.models.Number;\n\nimport timber.log.Timber;\n\nclass NumberPresenter implements NumberContract.Presenter {\n\n private NumberContract.View view;\n\n private NumberContract.Interactor interactor;\n\n private NumberMapper mapper;\n\n NumberPresenter(NumberContract.Interactor interactor) {\n this.interactor = interactor;\n this.mapper = new NumberMapper();\n }\n\n @Override\n public void setView(NumberContract.View view) {\n this.view = view;\n }\n\n @Override\n public void setupView() {\n \/\/TODO Figure out how to unsubscribe\n interactor.getNumber().subscribe(this::displayNumber);\n interactor.onNumberUpdated().subscribe(this::onNumberUpdated);\n }\n\n @Override\n public void onNumberUpdated(Number number) {\n Timber.d(\"Number updated to: %d\", number.value);\n displayNumber(number);\n }\n\n @Override\n public void incrementNumberBy10() {\n Timber.d(\"Incrementing number by 10\");\n interactor.incrementNumberBy(10);\n }\n\n private void displayNumber(Number number) {\n view.display(mapper.map(number));\n }\n}\n","new_contents":"package com.malpo.sliver.sample.ui.number;\n\nimport com.malpo.sliver.sample.models.Number;\n\nimport timber.log.Timber;\n\nclass NumberPresenter implements NumberContract.Presenter {\n\n private NumberContract.View view;\n\n private NumberContract.Interactor interactor;\n\n private NumberMapper mapper;\n\n NumberPresenter(NumberContract.Interactor interactor) {\n this.interactor = interactor;\n this.mapper = new NumberMapper();\n }\n\n @Override\n public void setView(NumberContract.View view) {\n this.view = view;\n }\n\n @Override\n public void setupView() {\n \/\/TODO Figure out how to unsubscribe\n interactor.getNumber().subscribe(this::onNumberUpdated);\n interactor.onNumberUpdated().subscribe(this::onNumberUpdated);\n }\n\n @Override\n public void onNumberUpdated(Number number) {\n Timber.d(\"Number updated to: %d\", number.value);\n view.display(mapper.map(number));\n }\n\n @Override\n public void incrementNumberBy10() {\n Timber.d(\"Incrementing number by 10\");\n interactor.incrementNumberBy(10);\n }\n}\n","subject":"Use Overriden, not private method to interact with presenter"} {"old_contents":"package com.amalgam.view;\n\nimport android.content.res.Resources;\nimport android.util.DisplayMetrics;\nimport android.view.WindowManager;\n\npublic final class ViewUtils {\n private ViewUtils() {}\n\n \/**\n * Convert the dips to pixels, based on density scale\n *\n * @param resources application resources\n * @param dip to be converted value\n * @return converted value(px)\n *\/\n public static int dipToPixel(Resources resources, int dip) {\n final float scale = resources.getDisplayMetrics().density;\n \/\/ add 0.5f to round the figure up to the nearest whole number\n return (int) (dip * scale + 0.5f);\n }\n\n \/**\n * Convert the pixels to dips, based on density scale\n * @param windowManager the window manager of the display to use the scale density of\n * @param pixel\n * @return converted value(dip)\n *\/\n public static float pixelToDip(WindowManager windowManager, int pixel) {\n float dip = 0;\n DisplayMetrics metrics = new DisplayMetrics();\n windowManager.getDefaultDisplay().getMetrics(metrics);\n dip = metrics.scaledDensity * pixel;\n return dip;\n }\n}","new_contents":"package com.amalgam.view;\n\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.hardware.display.DisplayManager;\nimport android.util.DisplayMetrics;\nimport android.view.WindowManager;\n\nimport com.amalgam.content.ContextUtils;\n\npublic final class ViewUtils {\n private ViewUtils() {}\n\n public static int dipToPixel(Context context, int dip) {\n return dipToPixel(context.getResources(), dip);\n }\n\n \/**\n * Convert the dips to pixels, based on density scale\n *\n * @param resources application resources\n * @param dip to be converted value\n * @return converted value(px)\n *\/\n public static int dipToPixel(Resources resources, int dip) {\n final float scale = resources.getDisplayMetrics().density;\n \/\/ add 0.5f to round the figure up to the nearest whole number\n return (int) (dip * scale + 0.5f);\n }\n\n public static float pixelToDip(Context context, int pixel) {\n return pixelToDip(ContextUtils.getWindowManager(context), pixel);\n }\n\n \/**\n * Convert the pixels to dips, based on density scale\n * @param windowManager the window manager of the display to use the scale density of\n * @param pixel\n * @return converted value(dip)\n *\/\n public static float pixelToDip(WindowManager windowManager, int pixel) {\n DisplayMetrics metrics = new DisplayMetrics();\n windowManager.getDefaultDisplay().getMetrics(metrics);\n return metrics.scaledDensity * pixel;\n }\n\n public static float sipToPixel(Context context, float sip) {\n return sipToPixel(context.getResources(), sip);\n }\n\n public static float sipToPixel(Resources resources, float sip) {\n float density = resources.getDisplayMetrics().scaledDensity;\n return sip * density;\n }\n\n public static float pixelToSip(Context context, float pixels) {\n DisplayMetrics metrics = new DisplayMetrics();\n float scaledDensity = metrics.scaledDensity;\n if (pixels == 0 || scaledDensity == 0) {\n return 1;\n }\n return pixels\/scaledDensity;\n }\n}","subject":"Add sip to pixel conversion"} {"old_contents":"\/*\n * Copyright 2017 ThoughtWorks, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.thoughtworks.go.utils;\n\n\nimport java.util.Arrays;\nimport java.util.TreeSet;\n\npublic class AssertJava8 {\n private static TreeSet SUPPORTED_VERSIONS = new TreeSet<>(Arrays.asList(\n JavaVersion.VERSION_1_8,\n JavaVersion.VERSION_1_9,\n JavaVersion.VERSION_1_10\n ));\n\n public static void assertVMVersion() {\n checkSupported(JavaVersion.current());\n }\n\n private static void checkSupported(JavaVersion currentJavaVersion) {\n if (!SUPPORTED_VERSIONS.contains(currentJavaVersion)) {\n System.err.println(\"Running GoCD requires Java version >= \" + SUPPORTED_VERSIONS.first().name() +\n \" and <= \" + SUPPORTED_VERSIONS.last() +\n \". You are currently running with Java version \" + currentJavaVersion + \". GoCD will now exit!\");\n System.exit(1);\n }\n }\n}\n","new_contents":"\/*\n * Copyright 2017 ThoughtWorks, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.thoughtworks.go.utils;\n\n\nimport java.util.Arrays;\nimport java.util.TreeSet;\n\npublic class AssertJava8 {\n private static TreeSet SUPPORTED_VERSIONS = new TreeSet<>(Arrays.asList(\n JavaVersion.VERSION_1_8,\n JavaVersion.VERSION_1_9,\n JavaVersion.VERSION_1_10,\n JavaVersion.VERSION_11\n ));\n\n public static void assertVMVersion() {\n checkSupported(JavaVersion.current());\n }\n\n private static void checkSupported(JavaVersion currentJavaVersion) {\n if (!SUPPORTED_VERSIONS.contains(currentJavaVersion)) {\n System.err.println(\"Running GoCD requires Java version >= \" + SUPPORTED_VERSIONS.first().name() +\n \" and <= \" + SUPPORTED_VERSIONS.last() +\n \". You are currently running with Java version \" + currentJavaVersion + \". GoCD will now exit!\");\n System.exit(1);\n }\n }\n}\n","subject":"Include java 11 to supported list"} {"old_contents":"package beaform.events;\n\nimport static org.junit.Assert.assertEquals;\n\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport beaform.utilities.SystemTime;\nimport beaform.utilities.TimeSource;\n\npublic class StoreEventTest {\n\n\t@Before\n\tpublic void setup() {\n\t\tSystemTime.setTimeSource(new TimeSource() {\n\t\t\tprivate final long timeInMillis = 0;\n\n\t\t\t@Override\n\t\t\tpublic long getSystemTime() {\n\t\t\t\treturn this.timeInMillis;\n\t\t\t}\n\t\t});\n\t}\n\n\t@After\n\tpublic void destroy() {\n\t\tSystemTime.reset();\n\t}\n\n\t@Test\n\tpublic void testEventString() {\n\t\t\/\/ Create a 'create' event for a new formula\n\t\tString name = \"TestFormula\";\n\t\tEvent createEvent = new FormulaCreatedEvent(name);\n\n\t\tDate timestamp = SystemTime.getAsDate();\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n\t\t\/\/ Check if the event converts to a string correctly\n\t\t\/\/ [timestamp] action properties\n\t\tassertEquals(\"[\" + df.format(timestamp) + \"] FormulaCreated \" + name, createEvent.toEventString());\n\t}\n\n}\n","new_contents":"package beaform.events;\n\nimport static org.junit.Assert.assertEquals;\n\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport beaform.utilities.SystemTime;\nimport beaform.utilities.TimeSource;\n\npublic class StoreEventTest {\n\n\t@Before\n\tpublic void setup() {\n\t\tSystemTime.setTimeSource(new TimeSource() {\n\t\t\tprivate final long timeInMillis = 0;\n\n\t\t\t@Override\n\t\t\tpublic long getSystemTime() {\n\t\t\t\treturn this.timeInMillis;\n\t\t\t}\n\t\t});\n\t}\n\n\t@After\n\tpublic void destroy() {\n\t\tSystemTime.reset();\n\t}\n\n\t@Test\n\tpublic void testEventString() {\n\t\t\/\/ Create a 'create' event for a new formula\n\t\tString name = \"TestFormula\";\n\t\tEvent createEvent = new FormulaCreatedEvent(name);\n\n\t\tDate timestamp = SystemTime.getAsDate();\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n\t\tString expectedResult = \"[\" + df.format(timestamp) + \"] FormulaCreated \" + name;\n\t\t\/\/ Check if the event converts to a string correctly\n\t\t\/\/ [timestamp] action properties\n\t\tString assertMessageOnFail = \"Event format doesn't match with the expected one\";\n\t\tassertEquals(assertMessageOnFail, expectedResult, createEvent.toEventString());\n\t}\n\n}\n","subject":"Add a message for the failing assertion"} {"old_contents":"package algorithms.trees;\n\npublic class TreeHeightCalculator {\n\tprivate final int parents[];\n\n\t\/**\n\t * @param parents\n\t * defines index of parent for each node. Value -1 determines a root node\n\t *\/\n\tpublic TreeHeightCalculator(int parents[]) {\n\t\tthis.parents = parents;\n\t}\n\n\tpublic int computeHeight() {\n\t\tTreeNode root = createTree();\n\t\treturn recursiveHeightCalculation(root);\n\t}\n\n\tprivate TreeNode createTree() {\n\t\tTreeNode[] nodes = new TreeNode[parents.length];\n\t\tfor (int i = 0; i < parents.length; i++) {\n\t\t\tnodes[i] = new TreeNode();\n\t\t}\n\t\tTreeNode root = null;\n\t\tfor (int i = 0; i < parents.length; i++) {\n\t\t\tint parentId = parents[i];\n\t\t\tif (parentId >= 0) {\n\t\t\t\tnodes[i].setParent(nodes[parentId]);\n\t\t\t\tnodes[parentId].getChildren().add(nodes[i]);\n\t\t\t} else {\n\t\t\t\troot = nodes[i];\n\t\t\t}\n\t\t}\n\t\treturn root;\n\t}\n\n\tprivate int recursiveHeightCalculation(TreeNode treeNode) {\n\t\tint max = 0;\n\t\tfor (TreeNode child : treeNode.getChildren()) {\n\t\t\tint newMax = recursiveHeightCalculation(child);\n\t\t\tif (newMax > max) {\n\t\t\t\tmax = newMax;\n\t\t\t}\n\t\t}\n\t\treturn ++max;\n\t}\n}\n","new_contents":"package algorithms.trees;\n\npublic class TreeHeightCalculator {\n\tprivate final int parents[];\n\n\t\/**\n\t * @param parents\n\t * defines index of parent for each node. Value -1 determines a root node\n\t *\/\n\tpublic TreeHeightCalculator(int parents[]) {\n\t\tthis.parents = parents;\n\t}\n\n\t\/**\n\t * assumptions: there is exactly one root and the input represents a tree\n\t *\/\n\tpublic int computeHeight() {\n\t\tTreeNode root = createTree();\n\t\treturn recursiveHeightCalculation(root);\n\t}\n\n\tprivate TreeNode createTree() {\n\t\tTreeNode[] nodes = new TreeNode[parents.length];\n\t\tfor (int i = 0; i < parents.length; i++) {\n\t\t\tnodes[i] = new TreeNode();\n\t\t}\n\t\tTreeNode root = null;\n\t\tfor (int i = 0; i < parents.length; i++) {\n\t\t\tint parentId = parents[i];\n\t\t\tif (parentId >= 0) {\n\t\t\t\tnodes[i].setParent(nodes[parentId]);\n\t\t\t\tnodes[parentId].getChildren().add(nodes[i]);\n\t\t\t} else {\n\t\t\t\troot = nodes[i];\n\t\t\t}\n\t\t}\n\t\treturn root;\n\t}\n\n\tprivate int recursiveHeightCalculation(TreeNode treeNode) {\n\t\tint max = 0;\n\t\tfor (TreeNode child : treeNode.getChildren()) {\n\t\t\tint newMax = recursiveHeightCalculation(child);\n\t\t\tif (newMax > max) {\n\t\t\t\tmax = newMax;\n\t\t\t}\n\t\t}\n\t\treturn ++max;\n\t}\n}\n","subject":"Document prerequisites for the algorithm"} {"old_contents":"package oasis.web.authn;\n\nimport java.io.IOException;\nimport java.net.URI;\n\nimport javax.annotation.Priority;\nimport javax.inject.Inject;\nimport javax.ws.rs.container.ContainerRequestContext;\nimport javax.ws.rs.container.ContainerRequestFilter;\nimport javax.ws.rs.core.Response;\nimport javax.ws.rs.ext.Provider;\n\nimport oasis.urls.Urls;\nimport oasis.web.resteasy.Resteasy1099;\n\n\/**\n * Enforce the use of the {@link oasis.urls.Urls#canonicalBaseUri() canonical base URI}\n * for cookie-based authentication.\n *\/\n@User\n@Provider\n@Priority(0)\npublic class UserCanonicalBaseUriFilter implements ContainerRequestFilter {\n\n @Inject Urls urls;\n\n @Override\n public void filter(ContainerRequestContext requestContext) throws IOException {\n if (!urls.canonicalBaseUri().isPresent()) {\n return; \/\/ nothing to do\n }\n if (requestContext.getUriInfo().getBaseUri().equals(urls.canonicalBaseUri().get())) {\n return; \/\/ we're already on the canonical base URI\n }\n\n URI relativeUri = Resteasy1099.getBaseUri(requestContext.getUriInfo()).relativize(requestContext.getUriInfo().getRequestUri());\n URI canonicalUri = urls.canonicalBaseUri().get().resolve(relativeUri);\n\n requestContext.abortWith(Response.status(Response.Status.MOVED_PERMANENTLY)\n .location(canonicalUri)\n .build());\n }\n}\n","new_contents":"package oasis.web.authn;\n\nimport java.io.IOException;\nimport java.net.URI;\n\nimport javax.annotation.Priority;\nimport javax.inject.Inject;\nimport javax.ws.rs.container.ContainerRequestContext;\nimport javax.ws.rs.container.ContainerRequestFilter;\nimport javax.ws.rs.core.Response;\nimport javax.ws.rs.ext.Provider;\n\nimport oasis.urls.Urls;\nimport oasis.web.resteasy.Resteasy1099;\n\n\/**\n * Enforce the use of the {@link oasis.urls.Urls#canonicalBaseUri() canonical base URI}\n * for cookie-based authentication.\n *\/\n@User\n@Provider\n@Priority(0)\npublic class UserCanonicalBaseUriFilter implements ContainerRequestFilter {\n\n @Inject Urls urls;\n\n @Override\n public void filter(ContainerRequestContext requestContext) throws IOException {\n if (!urls.canonicalBaseUri().isPresent()) {\n return; \/\/ nothing to do\n }\n if (Resteasy1099.getBaseUri(requestContext.getUriInfo()).equals(urls.canonicalBaseUri().get())) {\n return; \/\/ we're already on the canonical base URI\n }\n\n URI relativeUri = Resteasy1099.getBaseUri(requestContext.getUriInfo()).relativize(requestContext.getUriInfo().getRequestUri());\n URI canonicalUri = urls.canonicalBaseUri().get().resolve(relativeUri);\n\n requestContext.abortWith(Response.status(Response.Status.MOVED_PERMANENTLY)\n .location(canonicalUri)\n .build());\n }\n}\n","subject":"Fix redirect loops in HTTPS when canonical-base-uri is configured"} {"old_contents":"package com.vk.api.sdk.objects.messages;\n\nimport com.google.gson.annotations.SerializedName;\n\n\/**\n * Message action type\n *\/\npublic enum Action {\n\n @SerializedName(\"chat_photo_update\")\n CHAT_PHOTO_UPDATE(\"chat_photo_update\"),\n\n @SerializedName(\"chat_photo_remove\")\n CHAT_PHOTO_REMOVE(\"chat_photo_remove\"),\n\n @SerializedName(\"chat_create\")\n CHAT_CREATE(\"chat_create\"),\n\n @SerializedName(\"chat_title_update\")\n CHAT_TITLE_UPDATE(\"chat_title_update\"),\n\n @SerializedName(\"chat_invite_user\")\n CHAT_INVITE_USER(\"chat_invite_user\"),\n\n @SerializedName(\"chat_kick_user\")\n CHAT_KICK_USER(\"chat_kick_user\");\n\n private final String value;\n\n Action(String value) {\n this.value = value;\n }\n\n public String getValue() {\n return value;\n }\n}\n","new_contents":"package com.vk.api.sdk.objects.messages;\n\nimport com.google.gson.annotations.SerializedName;\n\n\/**\n * Message action type\n *\/\npublic enum Action {\n\n @SerializedName(\"chat_photo_update\")\n CHAT_PHOTO_UPDATE(\"chat_photo_update\"),\n\n @SerializedName(\"chat_photo_remove\")\n CHAT_PHOTO_REMOVE(\"chat_photo_remove\"),\n\n @SerializedName(\"chat_create\")\n CHAT_CREATE(\"chat_create\"),\n\n @SerializedName(\"chat_title_update\")\n CHAT_TITLE_UPDATE(\"chat_title_update\"),\n\n @SerializedName(\"chat_invite_user\")\n CHAT_INVITE_USER(\"chat_invite_user\"),\n\n @SerializedName(\"chat_kick_user\")\n CHAT_KICK_USER(\"chat_kick_user\"),\n\n @SerializedName(\"chat_pin_message\")\n CHAT_PIN_MESSAGE(\"chat_pin_message\"),\n\n @SerializedName(\"chat_unpin_message\")\n CHAT_UNPIN_MESSAGE(\"chat_unpin_message\"),\n\n @SerializedName(\"chat_invite_user_by_link\")\n CHAT_INVITE_USER_BY_LINK(\"chat_invite_user_by_link\");\n\n private final String value;\n\n Action(String value) {\n this.value = value;\n }\n\n public String getValue() {\n return value;\n }\n}\n","subject":"Add missing field in 'action' for 'Message' object"} {"old_contents":"package com.faforever.client.legacy;\n\nimport com.faforever.client.os.OsUtils;\nimport org.springframework.context.annotation.Lazy;\nimport org.springframework.context.annotation.Profile;\nimport org.springframework.stereotype.Service;\n\nimport java.nio.file.Path;\n\n\n@Lazy\n@Service\n@Profile({\"unix\", \"mac\"})\npublic class UnixUidService implements UidService {\n\n @Override\n public String generate(String sessionId, Path logFile) {\n String uidDir = System.getProperty(\"uid.dir\", \"lib\");\n return OsUtils.execAndGetOutput(String.format(\"%s\/uid %s\", uidDir, sessionId));\n }\n}\n","new_contents":"package com.faforever.client.legacy;\n\nimport com.faforever.client.os.OsUtils;\nimport org.springframework.context.annotation.Lazy;\nimport org.springframework.context.annotation.Profile;\nimport org.springframework.stereotype.Service;\n\nimport java.nio.file.Path;\n\n\n@Lazy\n@Service\n@Profile({\"linux\", \"mac\"})\npublic class UnixUidService implements UidService {\n\n @Override\n public String generate(String sessionId, Path logFile) {\n String uidDir = System.getProperty(\"uid.dir\", \"lib\");\n return OsUtils.execAndGetOutput(String.format(\"%s\/uid %s\", uidDir, sessionId));\n }\n}\n","subject":"Fix UidService not loaded on linux"} {"old_contents":"\/*\n * Copyright 2017 - 2018 Volker Berlin (i-net software)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage de.inetsoftware.jwebassembly;\n\nimport java.util.Arrays;\nimport java.util.Collection;\n\n\/**\n * @author Volker Berlin\n *\/\npublic enum ScriptEngine {\n NodeJS,\n SpiderMonkey,\n NodeWat,\n SpiderMonkeyWat,\n Wat2Wasm,\n ;\n\n public static Collection testParams() {\n ScriptEngine[][] val = { \/\/\n { ScriptEngine.SpiderMonkey }, \/\/\n { ScriptEngine.NodeJS }, \/\/\n { ScriptEngine.NodeWat }, \/\/\n\/\/ { ScriptEngine.SpiderMonkeyWat },\/\/\n { ScriptEngine.Wat2Wasm }, \/\/\n };\n return Arrays.asList(val);\n }\n}\n\n","new_contents":"\/*\n * Copyright 2017 - 2019 Volker Berlin (i-net software)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage de.inetsoftware.jwebassembly;\n\nimport java.util.Arrays;\nimport java.util.Collection;\n\n\/**\n * @author Volker Berlin\n *\/\npublic enum ScriptEngine {\n NodeJS,\n SpiderMonkey,\n NodeWat,\n SpiderMonkeyWat,\n Wat2Wasm,\n ;\n\n public static Collection testParams() {\n ScriptEngine[][] val = { \/\/\n { ScriptEngine.SpiderMonkey }, \/\/\n { ScriptEngine.NodeJS }, \/\/\n { ScriptEngine.NodeWat }, \/\/\n { ScriptEngine.SpiderMonkeyWat },\/\/\n { ScriptEngine.Wat2Wasm }, \/\/\n };\n return Arrays.asList(val);\n }\n}\n\n","subject":"Enable tests with SpiderMonkey WasmTextToBinary()"} {"old_contents":"\/*\n * MIT License\n *\n * Copyright (c) 2017 Hindol Adhya\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * https:\/\/github.com\/Hindol\/commons\n *\/\n\npackage net.aeronica.mods.mxtune.caches;\n\n\/**\n * Interface definition for services.\n *\/\npublic interface Service {\n \/**\n * Starts the service. This method blocks until the service has completely started.\n *\/\n void start() throws Exception;\n\n \/**\n * Stops the service. This method blocks until the service has completely shut down.\n *\/\n void stop();\n}","new_contents":"\/*\n * MIT License\n *\n * Copyright (c) 2017 Hindol Adhya\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * https:\/\/github.com\/Hindol\/commons\n *\/\n\npackage net.aeronica.mods.mxtune.caches;\n\nimport net.aeronica.mods.mxtune.util.MXTuneException;\n\n\/**\n * Interface definition for services.\n *\/\npublic interface Service {\n \/**\n * Starts the service. This method blocks until the service has completely started.\n *\/\n void start() throws MXTuneException;\n\n \/**\n * Stops the service. This method blocks until the service has completely shut down.\n *\/\n void stop();\n}","subject":"Use an application defined exception."} {"old_contents":"package org.cryptonit.cloud.timestamping;\n\nimport org.cryptonit.cloud.interfaces.TimestampingPolicy;\n\npublic class Policy implements TimestampingPolicy {\n\n String identity;\n String policyId;\n\n public Policy(String identity, String policyId) {\n this.identity = identity;\n this.policyId = policyId;\n }\n\n @Override\n public String getIdentity() {\n return identity;\n }\n\n @Override\n public String getPolicyId() {\n return policyId;\n }\n}\n","new_contents":"package org.cryptonit.cloud.timestamping;\n\nimport org.cryptonit.cloud.interfaces.TimestampingPolicy;\n\npublic class Policy implements TimestampingPolicy {\n\n String identity;\n String policyId;\n String algorithm;\n\n public Policy(String identity, String policyId, String algorithm) {\n this.identity = identity;\n this.policyId = policyId;\n this.algorithm = algorithm;\n }\n\n @Override\n public String getIdentity() {\n return identity;\n }\n\n @Override\n public String getPolicyId() {\n return policyId;\n }\n\n public String getAlgorithm() {\n return algorithm;\n }\n}\n","subject":"Add algorithm field in class"} {"old_contents":"\/*\n * Copyright (c) 2012 Mateusz Parzonka, Eric Bodden\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *\n * Contributors:\n * Mateusz Parzonka - initial API and implementation\n *\/\npackage prm4j.indexing.realtime;\n\nimport java.lang.ref.WeakReference;\n\nimport prm4j.indexing.map.MinimalMapEntry;\n\n\/**\n * A binding used by optimized indexing strategies.\n *\/\npublic interface LowLevelBinding extends prm4j.api.Binding, MinimalMapEntry{\n\n \/**\n * Releases all resources used in the indexing data structure and\/or notifies monitors about unreachability of the\n * parameter object. Amount of released resources can vary strongly with the implementation.\n *\/\n void release();\n\n \/**\n * Register a map where this binding is used.\n *\n * @param mapReference\n *\/\n void registerNode(WeakReference nodeReference); \/\/ TODO resource registration\n\n boolean isDisabled();\n\n void setDisabled(boolean disable);\n\n long getTimestamp();\n\n void setTimestamp(long timestamp);\n\n}\n","new_contents":"\/*\n * Copyright (c) 2012 Mateusz Parzonka, Eric Bodden\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *\n * Contributors:\n * Mateusz Parzonka - initial API and implementation\n *\/\npackage prm4j.indexing.realtime;\n\nimport java.lang.ref.WeakReference;\n\nimport prm4j.indexing.map.MinimalMapEntry;\n\n\/**\n * A binding used by optimized indexing strategies.\n *\/\npublic interface LowLevelBinding extends prm4j.api.Binding, MinimalMapEntry{\n\n \/**\n * Releases all resources used in the indexing data structure and\/or notifies monitors about unreachability of the\n * parameter object. Amount of released resources can vary strongly with the implementation.\n *\/\n void release();\n\n \/**\n * Register a map which uses this binding as key.\n *\n * @param nodeRef\n *\/\n void registerNode(WeakReference nodeRef);\n\n boolean isDisabled();\n\n void setDisabled(boolean disable);\n\n long getTimestamp();\n\n void setTimestamp(long timestamp);\n\n}\n","subject":"Remove todo and add comment"} {"old_contents":"package me.androidbox.busbymovies;\n\nimport android.support.test.espresso.assertion.ViewAssertions;\nimport android.support.test.rule.ActivityTestRule;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport me.androidbox.busbymovies.movielist.MovieListActivity;\n\nimport static android.support.test.espresso.Espresso.onView;\nimport static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;\nimport static android.support.test.espresso.matcher.ViewMatchers.withText;\n\n\/**\n * Created by steve on 2\/18\/17.\n *\/\n@RunWith(AndroidJUnit4.class)\npublic class MovieListViewImpTest {\n\n @Rule\n public final ActivityTestRule activityTestRule =\n new ActivityTestRule<>(MovieListActivity.class);\n\n @Test\n public void shouldDisplayCorrectTitleInToolbar() {\n onView(withText(R.string.app_name)).check(ViewAssertions.matches(isDisplayed()));\n }\n}\n","new_contents":"package me.androidbox.busbymovies;\n\nimport android.support.test.espresso.assertion.ViewAssertions;\nimport android.support.test.rule.ActivityTestRule;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport me.androidbox.busbymovies.movielist.MovieListActivity;\nimport me.androidbox.busbymovies.utils.RecyclerViewAssertions;\n\nimport static android.support.test.espresso.Espresso.onView;\nimport static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;\nimport static android.support.test.espresso.matcher.ViewMatchers.withId;\nimport static android.support.test.espresso.matcher.ViewMatchers.withText;\nimport static org.hamcrest.Matchers.equalTo;\n\n\/**\n * Created by steve on 2\/18\/17.\n *\/\n@RunWith(AndroidJUnit4.class)\npublic class MovieListViewImpTest {\n\n @Rule\n public final ActivityTestRule activityTestRule =\n new ActivityTestRule<>(MovieListActivity.class);\n\n @Test\n public void shouldDisplayCorrectTitleInToolbar() {\n onView(withText(R.string.app_name)).check(ViewAssertions.matches(isDisplayed()));\n }\n\n @Test\n public void shouldDisplayTwentyItemsInRecyclerView() {\n onView(withId(R.id.rvMovieList))\n .check(new RecyclerViewAssertions(equalTo(20)));\n }\n}\n","subject":"Add matcher for the recyclerview to get the number of items to compare with"} {"old_contents":"\/*\n * Copyright (C) 2015 iychoi\n *\n * This program is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; either version 2\n * of the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n *\/\npackage biospectra.utils;\n\nimport java.io.File;\nimport java.io.FileFilter;\n\n\/**\n *\n * @author iychoi\n *\/\npublic class FastaFileFilter implements FileFilter {\n \n private String[] EXTENSIONS = {\n \".fa\",\n \".fa.gz\",\n \".ffn.gz\",\n \".ffn\",\n \".fna.gz\",\n \".fna\"\n };\n \n @Override\n public boolean accept(File file) {\n String lowername = file.getName().toLowerCase();\n \n for(String ext : EXTENSIONS) {\n if(lowername.endsWith(ext)) {\n return true;\n }\n }\n \n return false;\n }\n}\n","new_contents":"\/*\n * Copyright (C) 2015 iychoi\n *\n * This program is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; either version 2\n * of the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n *\/\npackage biospectra.utils;\n\nimport java.io.File;\nimport java.io.FileFilter;\n\n\/**\n *\n * @author iychoi\n *\/\npublic class FastaFileFilter implements FileFilter {\n \n private String[] EXTENSIONS = {\n \".fa\",\n \".fa.gz\",\n \".ffn.gz\",\n \".ffn\",\n \".fna.gz\",\n \".fna\",\n \".fasta\",\n \".fasta.gz\"\n };\n \n @Override\n public boolean accept(File file) {\n String lowername = file.getName().toLowerCase();\n \n for(String ext : EXTENSIONS) {\n if(lowername.endsWith(ext)) {\n return true;\n }\n }\n \n return false;\n }\n}\n","subject":"Add more extensions for fasta filter"} {"old_contents":"package t16b4.yats.logic.commands;\n\n\n\/**\n * Lists all persons in the address book to the user.\n *\/\npublic class ListCommand extends Command {\n\n public static final String COMMAND_WORD = \"list\";\n public static final String COMMAND_WORD_SUFFIX_TITLE = \"list title\";\n public static final String COMMAND_WORD_SUFFIX_DATE = \"list date\";\n public static final String COMMAND_WORD_SUFFIX_TAG = \"list tag\";\n\n public static final String MESSAGE_SUCCESS = \"Listed all items\";\n\n\n @Override\n public CommandResult execute() {\n model.updateFilteredListToShowAll();\n return new CommandResult(MESSAGE_SUCCESS);\n }\n}\n","new_contents":"package t16b4.yats.logic.commands;\n\n\n\/**\n * Lists all persons in the address book to the user.\n *\/\npublic class ListCommand extends Command {\n\n public static final String COMMAND_WORD = \"list\";\n public static final String COMMAND_WORD_EXTENTION = \"by\";\n public static final String COMMAND_WORD_SUFFIX_TITLE = \"title\";\n public static final String COMMAND_WORD_SUFFIX_DEADLINE = \"deadline\";\n public static final String COMMAND_WORD_SUFFIX_TIMING = \"timing\";\n public static final String COMMAND_WORD_SUFFIX_TAG = \"tag\";\n\n public static final String MESSAGE_SUCCESS = \"Listed all items\";\n\n\n @Override\n public CommandResult execute() {\n model.updateFilteredListToShowAll();\n return new CommandResult(MESSAGE_SUCCESS);\n }\n}\n","subject":"Add more command extension and suffix"} {"old_contents":"package com.example.activity;\n\nimport android.app.Activity;\nimport org.junit.runner.RunWith;\nimport org.robolectric.Robolectric;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static org.junit.Assert.assertTrue;\n\n@RunWith(RobolectricTestRunner.class)\npublic class MainActivityTest {\n\n @org.junit.Test\n public void testSomething() throws Exception {\n Activity activity = Robolectric.setupActivity(MainActivity.class);\n assertTrue(activity.getTitle().toString().equals(\"Deckard\"));\n }\n}\n","new_contents":"package com.example.activity;\n\nimport android.app.Activity;\nimport org.junit.runner.RunWith;\nimport org.robolectric.Robolectric;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static org.junit.Assert.assertTrue;\n\n@RunWith(RobolectricTestRunner.class)\npublic class MainActivityTest {\n\n @org.junit.Test\n public void titleIsCorrect() throws Exception {\n Activity activity = Robolectric.setupActivity(MainActivity.class);\n assertTrue(activity.getTitle().toString().equals(\"Deckard\"));\n }\n}\n","subject":"Rename test to be correct"} {"old_contents":"package com.amee.restlet;\n\nimport org.restlet.data.Status;\n\npublic interface Fault {\n\n public String getMessage();\n\n public Status getStatus();\n\n public String getCode();\n}\n","new_contents":"package com.amee.restlet;\n\nimport org.restlet.data.Status;\n\npublic interface Fault {\n\n String getMessage();\n\n Status getStatus();\n\n String getCode();\n}\n","subject":"Remove redundant access modifiers. PL-11097."} {"old_contents":"package sample.github.nisrulz.customview;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.view.View;\n\npublic class CustomView extends View {\n\n Paint paint = new Paint();\n String text = \"Custom Text\";\n\n public CustomView(Context context) {\n super(context);\n\n paint.setColor(Color.BLACK);\n paint.setTextSize(30);\n }\n\n @Override protected void onDraw(Canvas canvas) {\n super.onDraw(canvas);\n\n setBackgroundColor(Color.BLUE);\n canvas.drawText(text, 100, 100, paint);\n\n }\n \n public void setText(String text) {\n this.text = text;\n invalidate();\n requestLayout();\n }\n\n\n}\n","new_contents":"package sample.github.nisrulz.customview;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.view.View;\n\npublic class CustomView extends View {\n\n Paint paint = new Paint();\n String text = \"Custom Text\";\n\n public CustomView(Context context) {\n super(context);\n\n paint.setColor(Color.BLACK);\n paint.setTextSize(30);\n }\n\n @Override protected void onDraw(Canvas canvas) {\n super.onDraw(canvas);\n\n setBackgroundColor(Color.BLUE);\n canvas.drawText(text, 100, 100, paint);\n\n }\n \n public void setText(String text) {\n this.text = text;\n invalidate();\n }\n\n\n}\n","subject":"Revert \"Added call to `requestLayout()` after `invalidate()`\""} {"old_contents":"package edu.rice.cs.caper.bayou.application.dom_driver;\n\nimport java.io.BufferedReader;\nimport java.io.FileReader;\nimport java.io.IOException;\n\n\/**\n * Batch DOM Driver that can work with a list of files having the same config\n *\/\npublic class BatchDriver {\n\n public static void main(String args[]) throws IOException, InterruptedException {\n if (args.length != 2) {\n System.out.println(\"Usage: dom-driver-batch.jar file-containing-list-of-files.txt config.json\");\n return;\n }\n\n String listFile = args[0];\n String configFile = args[1];\n BufferedReader br = new BufferedReader(new FileReader(listFile));\n String file;\n int NPROCS = Runtime.getRuntime().availableProcessors();\n System.out.println(\"Going to run \" + NPROCS + \" threads\");\n\n while ((file = br.readLine()) != null) {\n System.out.println(file);\n String[] driverArgs = { \"-f\", file, \"-c\", configFile, \"-o\", file + \".json\" };\n Thread thread = new Thread(() -> Driver.main(driverArgs));\n while (Thread.activeCount() >= NPROCS)\n Thread.sleep(10);\n thread.start();\n }\n }\n\n}\n","new_contents":"\/*\nCopyright 2017 Rice University\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*\/\npackage edu.rice.cs.caper.bayou.application.dom_driver;\n\nimport java.io.BufferedReader;\nimport java.io.FileReader;\nimport java.io.IOException;\n\n\/**\n * Batch DOM Driver that can work with a list of files having the same config\n *\/\npublic class BatchDriver {\n\n public static void main(String args[]) throws IOException, InterruptedException {\n if (args.length != 2) {\n System.out.println(\"Usage: dom-driver-batch.jar file-containing-list-of-files.txt config.json\");\n return;\n }\n\n String listFile = args[0];\n String configFile = args[1];\n BufferedReader br = new BufferedReader(new FileReader(listFile));\n String file;\n int NPROCS = Runtime.getRuntime().availableProcessors();\n System.out.println(\"Going to run \" + NPROCS + \" threads\");\n\n while ((file = br.readLine()) != null) {\n System.out.println(file);\n String[] driverArgs = { \"-f\", file, \"-c\", configFile, \"-o\", file + \".json\" };\n Thread thread = new Thread(() -> Driver.main(driverArgs));\n while (Thread.activeCount() >= NPROCS)\n Thread.sleep(10);\n thread.start();\n }\n }\n\n}\n","subject":"Add license header to batch DOM driver class"} {"old_contents":"\/*\n * Copyright (c) 2016 Reto Inderbitzin (mail@indr.ch)\n *\n * For the full copyright and license information, please view\n * the LICENSE file that was distributed with this source code.\n *\/\n\npackage ch.indr.threethreefive.services;\n\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\n\nimport rx.Observable;\n\npublic interface Speaker {\n int LEVEL_URGENT = 1;\n int LEVEL_QUEUED = 2;\n int LEVEL_IDLE = 3;\n\n float SPEECH_RATE_NORMAL = 0.8f;\n float SPEECH_RATE_SLOW = 0.65f;\n\n void start();\n\n void stop();\n\n \/**\n * Call this when TTS is no longer needed.\n *\/\n void shutdown();\n\n \/**\n * Observable that emits initialization status of the tts engine and language settings.\n *\/\n Observable status();\n\n Observable utteranceStart();\n\n Observable utteranceDone();\n\n Observable utteranceError();\n\n @NonNull CommandSpeaker command();\n\n @NonNull InstructionsSpeaker instructions();\n\n @Nullable String sayUrgent(CharSequence speech);\n\n @Nullable String sayUrgent(CharSequence speech, float speechRate);\n\n @Nullable String sayUrgent(int resourceId);\n\n @Nullable String sayQueued(CharSequence speech);\n\n @Nullable String sayQueued(CharSequence speech, float speechRate);\n\n @Nullable String sayQueued(int resourceId);\n\n @Nullable String sayIdle(CharSequence speech);\n\n @Nullable String say(CharSequence speech, int level);\n}\n\n","new_contents":"\/*\n * Copyright (c) 2016 Reto Inderbitzin (mail@indr.ch)\n *\n * For the full copyright and license information, please view\n * the LICENSE file that was distributed with this source code.\n *\/\n\npackage ch.indr.threethreefive.services;\n\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\n\nimport rx.Observable;\n\npublic interface Speaker {\n int LEVEL_URGENT = 1;\n int LEVEL_QUEUED = 2;\n int LEVEL_IDLE = 3;\n\n float SPEECH_RATE_NORMAL = 1.0f;\n float SPEECH_RATE_SLOW = 0.8f;\n\n void start();\n\n void stop();\n\n \/**\n * Call this when TTS is no longer needed.\n *\/\n void shutdown();\n\n \/**\n * Observable that emits initialization status of the tts engine and language settings.\n *\/\n Observable status();\n\n Observable utteranceStart();\n\n Observable utteranceDone();\n\n Observable utteranceError();\n\n @NonNull CommandSpeaker command();\n\n @NonNull InstructionsSpeaker instructions();\n\n @Nullable String sayUrgent(CharSequence speech);\n\n @Nullable String sayUrgent(CharSequence speech, float speechRate);\n\n @Nullable String sayUrgent(int resourceId);\n\n @Nullable String sayQueued(CharSequence speech);\n\n @Nullable String sayQueued(CharSequence speech, float speechRate);\n\n @Nullable String sayQueued(int resourceId);\n\n @Nullable String sayIdle(CharSequence speech);\n\n @Nullable String say(CharSequence speech, int level);\n}\n\n","subject":"Set speech rates to 1.0\/0.8"} {"old_contents":"package net.minecraftforge.fml.common.launcher;\n\nimport net.minecraft.launchwrapper.LaunchClassLoader;\nimport net.minecraftforge.fml.relauncher.FMLLaunchHandler;\n\npublic class FMLServerTweaker extends FMLTweaker {\n @Override\n public String getLaunchTarget()\n {\n return \"net.minecraft.server.MinecraftServer\";\n }\n\n @Override\n public void injectIntoClassLoader(LaunchClassLoader classLoader)\n {\n \/\/ The mojang packages are excluded so the log4j2 queue is correctly visible from\n \/\/ the obfuscated and deobfuscated parts of the code. Without, the UI won't show anything\n classLoader.addClassLoaderExclusion(\"com.mojang.\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.repackage.\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.relauncher.\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.common.asm.transformers.\");\n classLoader.addClassLoaderExclusion(\"LZMA.\");\n FMLLaunchHandler.configureForServerLaunch(classLoader, this);\n FMLLaunchHandler.appendCoreMods();\n }\n}\n","new_contents":"package net.minecraftforge.fml.common.launcher;\n\nimport net.minecraft.launchwrapper.LaunchClassLoader;\nimport net.minecraftforge.fml.relauncher.FMLLaunchHandler;\n\npublic class FMLServerTweaker extends FMLTweaker {\n @Override\n public String getLaunchTarget()\n {\n return \"net.minecraft.server.MinecraftServer\";\n }\n\n @Override\n public void injectIntoClassLoader(LaunchClassLoader classLoader)\n {\n \/\/ The log4j2 queue is excluded so it is correctly visible from the obfuscated\n \/\/ and deobfuscated parts of the code. Without, the UI won't show anything\n classLoader.addClassLoaderExclusion(\"com.mojang.util.QueueLogAppender\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.repackage.\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.relauncher.\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.common.asm.transformers.\");\n classLoader.addClassLoaderExclusion(\"LZMA.\");\n FMLLaunchHandler.configureForServerLaunch(classLoader, this);\n FMLLaunchHandler.appendCoreMods();\n }\n}\n","subject":"Exclude only log4j2 queue from class loader"} {"old_contents":"package com.grayben.riskExtractor.headingMarker.elector;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport com.grayben.riskExtractor.headingMarker.nominator.NominatedText;\n\npublic class ElectedText\n\n extends\n NominatedText\n\n implements\n\t ElecteesRetrievable {\n\n \/\/TODO: make this a set: should not have repetitions\n List electees;\n\n public ElectedText(List textList, List nominees, List electees){\n super(textList, nominees);\n if (electees == null) {\n throw new NullPointerException(\"Attempted to pass illegal null argument\");\n }\n this.electees = electees;\n }\n\n public ElectedText(NominatedText nominatedText, List electees){\n super(nominatedText);\n if (electees == null) {\n throw new NullPointerException(\"Attempted to pass illegal null argument\");\n }\n this.electees = electees;\n }\n\n public ElectedText(ElectedText electedText){\n this(electedText, electedText.getElectees());\n }\n\n @Override\n public List getElectees() {\n return Collections.unmodifiableList(this.electees);\n }\n\n}\n","new_contents":"package com.grayben.riskExtractor.headingMarker.elector;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport com.grayben.riskExtractor.headingMarker.nominator.NominatedText;\n\npublic class ElectedText\n\n extends\n NominatedText\n\n implements\n\t ElecteesRetrievable {\n\n \/\/TODO: make this a set: should not have repetitions\n List electees;\n\n public ElectedText(List textList, List nominees, List electees){\n super(textList, nominees);\n if (electees == null) {\n throw new NullPointerException(\"Attempted to pass illegal null argument\");\n }\n if ( ! nominees.containsAll(electees))\n throw new IllegalArgumentException(\n \"The electees argument was not a subset \" +\n \"of the nominees argument\"\n );\n this.electees = electees;\n }\n\n public ElectedText(NominatedText nominatedText, List electees){\n this(\n nominatedText.getStringList(),\n nominatedText.getNominees(),\n electees\n );\n }\n\n public ElectedText(ElectedText electedText){\n this(electedText, electedText.getElectees());\n }\n\n @Override\n public List getElectees() {\n return Collections.unmodifiableList(this.electees);\n }\n\n}\n","subject":"Make init throw exception when electees not subset of nominees"} {"old_contents":"package io.core9.module.auth.standard;\n\nimport io.core9.plugin.database.repository.AbstractCrudEntity;\nimport io.core9.plugin.database.repository.Collection;\nimport io.core9.plugin.database.repository.CrudEntity;\n\nimport java.util.Set;\n\nimport org.apache.shiro.crypto.hash.Sha256Hash;\n\n@Collection(\"core.users\")\npublic class UserEntity extends AbstractCrudEntity implements CrudEntity {\n\t\n\tprivate String username;\n\tprivate String password;\n\tprivate String salt;\n\tprivate Set roles;\n\n\tpublic String getUsername() {\n\t\treturn username;\n\t}\n\n\tpublic void setUsername(String username) {\n\t\tthis.username = username;\n\t}\n\n\tpublic String getPassword() {\n\t\treturn password;\n\t}\n\n\tpublic void setPassword(String password) {\n\t\tthis.password = password;\n\t}\n\n\tpublic String getSalt() {\n\t\treturn salt;\n\t}\n\n\tpublic void setSalt(String salt) {\n\t\tthis.salt = salt;\n\t}\n\n\tpublic Set getRoles() {\n\t\treturn roles;\n\t}\n\n\tpublic void setRoles(Set roles) {\n\t\tthis.roles = roles;\n\t}\n\t\n\tpublic void hashPassword(String source) {\n\t\tthis.password = new Sha256Hash(source, salt).toString();\n\t}\n\n}\n","new_contents":"package io.core9.module.auth.standard;\n\nimport io.core9.plugin.database.repository.AbstractCrudEntity;\nimport io.core9.plugin.database.repository.Collection;\nimport io.core9.plugin.database.repository.CrudEntity;\n\nimport java.math.BigInteger;\nimport java.security.SecureRandom;\nimport java.util.Set;\n\nimport org.apache.shiro.crypto.hash.Sha256Hash;\n\n@Collection(\"core.users\")\npublic class UserEntity extends AbstractCrudEntity implements CrudEntity {\n\t\n\tprivate String username;\n\tprivate String password;\n\tprivate String salt;\n\tprivate Set roles;\n\n\tpublic String getUsername() {\n\t\treturn username;\n\t}\n\n\tpublic void setUsername(String username) {\n\t\tthis.username = username;\n\t}\n\n\tpublic String getPassword() {\n\t\treturn password;\n\t}\n\n\tpublic void setPassword(String password) {\n\t\tthis.password = password;\n\t}\n\n\tpublic String getSalt() {\n\t\treturn salt;\n\t}\n\n\tpublic void setSalt(String salt) {\n\t\tthis.salt = salt;\n\t}\n\n\tpublic Set getRoles() {\n\t\treturn roles;\n\t}\n\n\tpublic void setRoles(Set roles) {\n\t\tthis.roles = roles;\n\t}\n\t\n\tpublic void hashPassword(String source) {\n\t\tif(source == null) {\n\t\t\tSecureRandom random = new SecureRandom();\n\t\t\tsource = new BigInteger(130, random).toString(32);\n\t\t}\n\t\tthis.password = new Sha256Hash(source, salt).toString();\n\t}\n\n}\n","subject":"Create dummy password on null"} {"old_contents":"package io.castle.client.model;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.List;\n\npublic class CastleUserDevices {\n int totalCount;\n @SerializedName(\"data\")\n List devices;\n\n public int getTotalCount() {\n return totalCount;\n }\n\n public void setTotalCount(int totalCount) {\n this.totalCount = totalCount;\n }\n\n public List getDevices() {\n return devices;\n }\n\n public void setDevices(List devices) {\n this.devices = devices;\n }\n}\n","new_contents":"package io.castle.client.model;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.List;\n\npublic class CastleUserDevices {\n private int totalCount;\n @SerializedName(\"data\")\n private List devices;\n\n public int getTotalCount() {\n return totalCount;\n }\n\n public List getDevices() {\n return devices;\n }\n\n public void setDevices(List devices) {\n this.devices = devices;\n this.totalCount = devices != null ? devices.size() : 0;\n }\n}\n","subject":"Set totalCount field automatically in setter for devices"} {"old_contents":"package carpentersblocks.util.handler;\n\nimport carpentersblocks.tileentity.TEBase;\nimport carpentersblocks.tileentity.TECarpentersDaylightSensor;\nimport carpentersblocks.tileentity.TECarpentersFlowerPot;\nimport carpentersblocks.tileentity.TECarpentersSafe;\nimport carpentersblocks.tileentity.TECarpentersTorch;\nimport cpw.mods.fml.common.registry.GameRegistry;\n\npublic class TileEntityHandler {\n\n \/**\n * Registers tile entities.\n *\/\n public static void registerTileEntities()\n {\n GameRegistry.registerTileEntity( TEBase.class, \"TileEntityCarpentersBlock\");\n GameRegistry.registerTileEntity(TECarpentersDaylightSensor.class, \"TileEntityCarpentersDaylightSensor\");\n GameRegistry.registerTileEntity( TECarpentersTorch.class, \"TileEntityCarpentersTorch\");\n GameRegistry.registerTileEntity( TECarpentersSafe.class, \"TileEntityCarpentersSafe\");\n GameRegistry.registerTileEntity( TECarpentersFlowerPot.class, \"TileEntityCarpentersFlowerPot\");\n }\n\n}\n","new_contents":"package carpentersblocks.util.handler;\n\nimport carpentersblocks.tileentity.TEBase;\nimport carpentersblocks.tileentity.TECarpentersDaylightSensor;\nimport carpentersblocks.tileentity.TECarpentersFlowerPot;\nimport carpentersblocks.tileentity.TECarpentersSafe;\nimport carpentersblocks.tileentity.TECarpentersTorch;\nimport cpw.mods.fml.common.registry.GameRegistry;\n\npublic class TileEntityHandler {\n\n \/**\n * Registers tile entities.\n *\/\n public static void registerTileEntities()\n {\n GameRegistry.registerTileEntity( TEBase.class, \"TileEntityCarpentersBlock\");\n GameRegistry.registerTileEntity(TECarpentersDaylightSensor.class, \"TileEntityCarpentersDaylightSensor\");\n GameRegistry.registerTileEntity( TECarpentersTorch.class, \"TileEntityCarpentersTorch\");\n GameRegistry.registerTileEntity( TECarpentersSafe.class, \"TileEntityCarpentersSafe\");\n GameRegistry.registerTileEntity( TECarpentersFlowerPot.class, \"TileEntityCarpentersFlowerPot\");\n\n registerCompatibilityMappings();\n }\n\n \/**\n * Add tile entity class mappings needed to retain compatibility\n * with older versions of this mod.\n *\/\n private static void registerCompatibilityMappings()\n {\n GameRegistry.registerTileEntity( TEBase.class, \"TileEntityCarpentersSlope\"); \/\/ Mapping prior to MC 1.7+ migration\n GameRegistry.registerTileEntity(TECarpentersDaylightSensor.class, \"TileEntityCarpentersExt\"); \/\/ Mapping prior to MC 1.7+ migration\n }\n\n}\n","subject":"Add tile entity mappings to support 1.6.4 migrated worlds."} {"old_contents":"package com.obidea.semantika.cli2.command;\n\nimport com.obidea.semantika.cli2.runtime.ConsoleSession;\n\npublic class CommandFactory\n{\n public static Command create(String command, ConsoleSession session) throws Exception\n {\n if (startsWith(command, Command.SELECT)) {\n return new SelectCommand(command, session);\n }\n else if (startsWith(command, Command.SET_PREFIX)) {\n return new SetPrefixCommand(command, session);\n }\n else if (startsWith(command, Command.SHOW_PREFIXES)) {\n return new ShowPrefixesCommand(command, session);\n }\n throw new Exception(\"Unknown command\"); \/\/$NON-NLS-1$\n }\n\n private static boolean startsWith(String command, String keyword)\n {\n return command.startsWith(keyword) || command.startsWith(keyword.toUpperCase());\n }\n}\n","new_contents":"package com.obidea.semantika.cli2.command;\n\nimport com.obidea.semantika.cli2.runtime.ConsoleSession;\nimport com.obidea.semantika.cli2.runtime.UnknownCommandException;\n\npublic class CommandFactory\n{\n public static Command create(String command, ConsoleSession session) throws UnknownCommandException\n {\n if (startsWith(command, Command.SELECT)) {\n return new SelectCommand(command, session);\n }\n else if (startsWith(command, Command.SET_PREFIX)) {\n return new SetPrefixCommand(command, session);\n }\n else if (startsWith(command, Command.SHOW_PREFIXES)) {\n return new ShowPrefixesCommand(command, session);\n }\n throw new UnknownCommandException(); \/\/$NON-NLS-1$\n }\n\n private static boolean startsWith(String command, String keyword)\n {\n return command.startsWith(keyword) || command.startsWith(keyword.toUpperCase());\n }\n}\n","subject":"Use CommandUnknown exception in the method create."} {"old_contents":"package com.faforever.api.data.domain;\n\npublic enum Validity {\n \/\/ Order is crucial\n VALID,\n TOO_MANY_DESYNCS,\n WRONG_VICTORY_CONDITION,\n NO_FOG_OF_WAR,\n CHEATS_ENABLED,\n PREBUILT_ENABLED,\n NORUSH_ENABLED,\n BAD_UNIT_RESTRICTIONS,\n BAD_MAP,\n TOO_SHORT,\n BAD_MOD,\n COOP_NOT_RANKED,\n MUTUAL_DRAW,\n SINGLE_PLAYER,\n FFA_NOT_RANKED,\n UNEVEN_TEAMS_NOT_RANKED,\n UNKNOWN_RESULT,\n TEAMS_UNLOCKED,\n MULTIPLE_TEAMS,\n HAS_AI\n}\n","new_contents":"package com.faforever.api.data.domain;\n\npublic enum Validity {\n \/\/ Order is crucial\n VALID,\n TOO_MANY_DESYNCS,\n WRONG_VICTORY_CONDITION,\n NO_FOG_OF_WAR,\n CHEATS_ENABLED,\n PREBUILT_ENABLED,\n NORUSH_ENABLED,\n BAD_UNIT_RESTRICTIONS,\n BAD_MAP,\n TOO_SHORT,\n BAD_MOD,\n COOP_NOT_RANKED,\n MUTUAL_DRAW,\n SINGLE_PLAYER,\n FFA_NOT_RANKED,\n UNEVEN_TEAMS_NOT_RANKED,\n UNKNOWN_RESULT,\n TEAMS_UNLOCKED,\n MULTIPLE_TEAMS,\n HAS_AI,\n CIVILIANS_REVEALED,\n WRONG_DIFFICULTY,\n EXPANSION_DISABLED,\n SPAWN_NOT_FIXED\n}\n","subject":"Add validity states needed by some coop leaderboard checks"} {"old_contents":"\/*\n * Copyright 2016 Will Knez \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.solsticesquared.schelling;\n\n\/**\n * The main driver for the Schelling project.\n *\/\npublic final class AppEntry {\n\n \/**\n * The application entry point.\n *\n * @param args\n * The array of command line arguments, if any.\n *\/\n public static void main(final String[] args) {\n }\n\n \/**\n * Constructor (private).\n *\/\n private AppEntry() {\n }\n}\n","new_contents":"\/*\n * Copyright 2016 Will Knez \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.solsticesquared.schelling;\n\nimport com.solsticesquared.schelling.ui.SchellingExplorerConsole;\nimport com.solsticesquared.schelling.ui.SchellingExplorerWithUi;\nimport sim.display.Console;\nimport sim.display.GUIState;\nimport sim.engine.SimState;\n\nimport javax.swing.SwingUtilities;\n\n\/**\n * The main driver for the Schelling project.\n *\/\npublic final class AppEntry {\n\n \/**\n * The application entry point.\n *\n * @param args\n * The array of command line arguments, if any.\n *\/\n public static void main(final String[] args) {\n SwingUtilities.invokeLater(() -> {\n \/\/ The random number generation seed.\n final long seed = System.currentTimeMillis();\n\n \/\/ The underlying Schelling-based model.\n final SimState model =\n SchellingExplorerUtils.createTwoGroupModel(seed);\n \/\/ The user interface.\n final GUIState view = new SchellingExplorerWithUi(model);\n \/\/ The user interface controller.\n final Console controller = new SchellingExplorerConsole(view);\n\n \/\/ Run.\n controller.setVisible(true);\n });\n }\n\n \/**\n * Constructor (private).\n *\/\n private AppEntry() {\n }\n}\n","subject":"Update application entry point to use custom controller implementation."} {"old_contents":"package it.near.sdk.Utils;\n\nimport android.content.Intent;\n\nimport it.near.sdk.Reactions.Content.Content;\nimport it.near.sdk.Reactions.Coupon.Coupon;\nimport it.near.sdk.Reactions.CustomJSON.CustomJSON;\nimport it.near.sdk.Reactions.Feedback.Feedback;\nimport it.near.sdk.Reactions.Poll.Poll;\nimport it.near.sdk.Reactions.SimpleNotification.SimpleNotification;\n\n\/**\n * Interface for being notified of core content types.\n *\n * @author cattaneostefano\n *\/\npublic interface CoreContentsListener {\n void getPollNotification(Intent intent, Poll notification, String recipeId);\n void getContentNotification(Intent intent, Content notification, String recipeId);\n void getCouponNotification(Intent intent, Coupon notification, String recipeId);\n void getCustomJSONNotification(Intent intent, CustomJSON notification, String recipeId);\n void getSimpleNotification(Intent intent, SimpleNotification s_notif, String recipeId);\n void getFeedbackNotification(Intent intent, Feedback s_notif, String recipeId);\n}\n","new_contents":"package it.near.sdk.Utils;\n\nimport android.content.Intent;\nimport android.support.annotation.Nullable;\n\nimport it.near.sdk.Reactions.Content.Content;\nimport it.near.sdk.Reactions.Coupon.Coupon;\nimport it.near.sdk.Reactions.CustomJSON.CustomJSON;\nimport it.near.sdk.Reactions.Feedback.Feedback;\nimport it.near.sdk.Reactions.Poll.Poll;\nimport it.near.sdk.Reactions.SimpleNotification.SimpleNotification;\n\n\/**\n * Interface for being notified of core content types.\n *\n * @author cattaneostefano\n *\/\npublic interface CoreContentsListener {\n void getPollNotification(@Nullable Intent intent, Poll notification, String recipeId);\n void getContentNotification(@Nullable Intent intent, Content notification, String recipeId);\n void getCouponNotification(@Nullable Intent intent, Coupon notification, String recipeId);\n void getCustomJSONNotification(@Nullable Intent intent, CustomJSON notification, String recipeId);\n void getSimpleNotification(@Nullable Intent intent, SimpleNotification s_notif, String recipeId);\n void getFeedbackNotification(@Nullable Intent intent, Feedback s_notif, String recipeId);\n}\n","subject":"Add nullable to corecontentlistner methods parameters"} {"old_contents":"\nimport interfaces.*;\n\nimport java.net.ServerSocket;\nimport java.net.Socket;\nimport java.util.ArrayList;\nimport java.util.List;\n\n\/**\n * Chat Server for various clients\n *\/\npublic class MultiUserChatServer implements IChatServer {\n private List clients = new ArrayList<>();\n private ServerSocket ss;\n\n private static int PORT = 8200;\n\n public void setupServer() {\n try {\n ss = new ServerSocket(PORT);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n public void waitForClients() {\n try {\n while (true) {\n Socket clientSocket = ss.accept();\n ConnectedClient client = new ConnectedClient(clientSocket, this);\n clients.add(client);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n public List getClients() {\n return clients;\n }\n}\n","new_contents":"\nimport interfaces.*;\n\nimport java.net.ServerSocket;\nimport java.net.Socket;\nimport java.util.ArrayList;\nimport java.util.List;\n\n\/**\n * Chat Server for various clients\n *\/\npublic class MultiUserChatServer implements IChatServer {\n private List clients = new ArrayList<>();\n private ServerSocket ss;\n\n private static int PORT = 8200;\n\n public void setupServer() {\n try {\n ss = new ServerSocket(PORT);\n System.out.println(\"Server listening on port \" + PORT);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n public void waitForClients() {\n try {\n while (true) {\n Socket clientSocket = ss.accept();\n ConnectedClient client = new ConnectedClient(clientSocket, this);\n System.out.println(\"New client connected from \" + clientSocket.getInetAddress().getHostAddress());\n clients.add(client);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n public List getClients() {\n return clients;\n }\n}\n","subject":"Add some log messeges to server"} {"old_contents":"package com.iluwatar.callback;\n\n\/**\n * \n * Implementation of task that need to be executed\n * \n *\/\npublic class SimpleTask extends Task {\n\n\t@Override\n\tpublic void execute() {\n\t\tSystem.out.println(\"Perform some important activity.\");\n\t}\n\n}\n","new_contents":"package com.iluwatar.callback;\n\n\/**\n * \n * Implementation of task that need to be executed\n * \n *\/\npublic class SimpleTask extends Task {\n\n\t@Override\n\tpublic void execute() {\n\t\tSystem.out.println(\"Perform some important activity and after call the callback method.\");\n\t}\n\n}\n","subject":"Add unit test to show that the callback method is called."} {"old_contents":"\/*\n * Copyright (c) 1998-2014 by Richard A. Wilkes. All rights reserved.\n *\n * This Source Code Form is subject to the terms of the Mozilla Public License,\n * version 2.0. If a copy of the MPL was not distributed with this file, You\n * can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n *\n * This Source Code Form is \"Incompatible With Secondary Licenses\", as defined\n * by the Mozilla Public License, version 2.0.\n *\/\n\npackage com.trollworks.gcs.app;\n\nimport com.trollworks.toolkit.utility.Launcher;\n\n\/**\n * This class is to be compiled with Java 1.1 to allow it to be loaded and executed even on very old\n * JVM's.\n *\/\npublic class GCS {\n\tpublic static void main(String[] args) {\n\t\tLauncher.launch(\"1.8\", \"com.trollworks.gcs.app.GCS\", args); \/\/$NON-NLS-1$ \/\/$NON-NLS-2$\n\t}\n}\n","new_contents":"\/*\n * Copyright (c) 1998-2014 by Richard A. Wilkes. All rights reserved.\n *\n * This Source Code Form is subject to the terms of the Mozilla Public License,\n * version 2.0. If a copy of the MPL was not distributed with this file, You\n * can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n *\n * This Source Code Form is \"Incompatible With Secondary Licenses\", as defined\n * by the Mozilla Public License, version 2.0.\n *\/\n\npackage com.trollworks.gcs.app;\n\nimport com.trollworks.toolkit.utility.Launcher;\n\n\/**\n * This class is to be compiled with Java 1.1 to allow it to be loaded and executed even on very old\n * JVM's.\n *\/\npublic class GCS {\n\tpublic static void main(String[] args) {\n\t\tLauncher.launch(\"1.8\", \"com.trollworks.gcs.app.GCSMain\", args); \/\/$NON-NLS-1$ \/\/$NON-NLS-2$\n\t}\n}\n","subject":"Use the correct class name."} {"old_contents":"package de.slikey.effectlib.effect;\n\nimport de.slikey.effectlib.EffectManager;\nimport de.slikey.effectlib.EffectType;\nimport de.slikey.effectlib.util.RandomUtils;\nimport org.bukkit.Effect;\nimport org.bukkit.Location;\nimport org.bukkit.entity.Entity;\n\npublic class BleedEffect extends de.slikey.effectlib.Effect {\n\n \/**\n * Play the Hurt Effect for the Player\n *\/\n public boolean hurt = true;\n\n \/**\n * Height of the blood spurt\n *\/\n public double height = 1.75;\n\n \/**\n * Color of blood. Default is red (152)\n *\/\n public int color = 152;\n\n public BleedEffect(EffectManager effectManager) {\n super(effectManager);\n type = EffectType.REPEATING;\n period = 4;\n iterations = 25;\n }\n\n @Override\n public void onRun() {\n \/\/ Location to spawn the blood-item.\n Location location = getLocation();\n location.add(0, RandomUtils.random.nextFloat() * height, 0);\n location.getWorld().playEffect(location, Effect.STEP_SOUND, color);\n\n Entity entity = getEntity();\n if (hurt && entity != null) {\n entity.playEffect(org.bukkit.EntityEffect.HURT);\n }\n }\n}\n","new_contents":"package de.slikey.effectlib.effect;\n\nimport de.slikey.effectlib.EffectManager;\nimport de.slikey.effectlib.EffectType;\nimport de.slikey.effectlib.util.RandomUtils;\nimport org.bukkit.Effect;\nimport org.bukkit.Location;\nimport org.bukkit.Material;\nimport org.bukkit.entity.Entity;\n\npublic class BleedEffect extends de.slikey.effectlib.Effect {\n\n \/**\n * Play the Hurt Effect for the Player\n *\/\n public boolean hurt = true;\n\n \/**\n * Height of the blood spurt\n *\/\n public double height = 1.75;\n\n \/**\n * Color of blood. Default is red (152)\n *\/\n public Material material = Material.REDSTONE_BLOCK;\n\n public BleedEffect(EffectManager effectManager) {\n super(effectManager);\n type = EffectType.REPEATING;\n period = 4;\n iterations = 25;\n }\n\n @Override\n public void onRun() {\n \/\/ Location to spawn the blood-item.\n Location location = getLocation();\n location.add(0, RandomUtils.random.nextFloat() * height, 0);\n location.getWorld().playEffect(location, Effect.STEP_SOUND, material);\n\n Entity entity = getEntity();\n if (hurt && entity != null) {\n entity.playEffect(org.bukkit.EntityEffect.HURT);\n }\n }\n}\n","subject":"Change Bleed effect to use a material rather than a mysterious color id"} {"old_contents":"\/\/ ------------------------------------------------------------------------------\n\/\/ Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.\n\/\/ ------------------------------------------------------------------------------\n\npackage com.microsoft.graph.models.extensions;\n\nimport com.microsoft.graph.concurrency.*;\nimport com.microsoft.graph.core.*;\nimport com.microsoft.graph.models.extensions.*;\nimport com.microsoft.graph.models.generated.*;\nimport com.microsoft.graph.http.*;\nimport com.microsoft.graph.requests.extensions.*;\nimport com.microsoft.graph.requests.generated.*;\nimport com.microsoft.graph.options.*;\nimport com.microsoft.graph.serializer.*;\n\nimport java.util.Arrays;\nimport java.util.EnumSet;\n\n\/\/ This file is available for extending, afterwards please submit a pull request.\n\n\/**\n * The class for the Planner Applied Categories.\n *\/\npublic class PlannerAppliedCategories extends BasePlannerAppliedCategories {\n\n}\n","new_contents":"\/\/ ------------------------------------------------------------------------------\n\/\/ Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.\n\/\/ ------------------------------------------------------------------------------\n\npackage com.microsoft.graph.models.extensions;\n\nimport com.google.gson.annotations.Expose;\nimport com.google.gson.annotations.SerializedName;\nimport com.microsoft.graph.models.generated.BasePlannerAppliedCategories;\n\n\/\/ This file is available for extending, afterwards please submit a pull request.\n\n\/**\n * The class for the Planner Applied Categories.\n *\/\npublic class PlannerAppliedCategories extends BasePlannerAppliedCategories {\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category1\")\n\t@Expose\n\tpublic boolean category1;\n\t\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category2\")\n\t@Expose\n\tpublic boolean category2;\n\t\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category3\")\n\t@Expose\n\tpublic boolean category3;\n\t\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category4\")\n\t@Expose\n\tpublic boolean category4;\n\t\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category5\")\n\t@Expose\n\tpublic boolean category5;\n\t\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category6\")\n\t@Expose\n\tpublic boolean category6;\n}\n","subject":"Add Planner Applied Categories extension"} {"old_contents":"package crawlers.facebook;\n\nimport org.apache.commons.io.IOUtils;\n\nimport java.io.*;\n\nimport org.jsoup.Connection;\nimport org.jsoup.Jsoup;\nimport org.jsoup.nodes.Document;\nimport play.Logger;\n\nclass FacebookSession {\n private static final String COOKIES_FILENAME = \"\/facebook_cookies\";\n\n private String cookies;\n\n FacebookSession() {\n InputStream secretsStream = getClass().getResourceAsStream(COOKIES_FILENAME);\n\n try {\n cookies = IOUtils.toString(secretsStream, \"utf8\").trim();\n } catch (IOException e) {\n Logger.warn(\"Cannot open Facebook cookies file \" + COOKIES_FILENAME);\n }\n }\n\n Connection getConnection(String uri) {\n Connection c = Jsoup.connect(uri);\n c.header(\"cookie\", cookies);\n c.header(\"user-agent\", \"Mozilla\/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36\");\n return c;\n }\n\n Document getDocument(String uri) throws IOException {\n return getConnection(uri).execute().parse();\n }\n}\n","new_contents":"package crawlers.facebook;\n\nimport org.apache.commons.io.IOUtils;\n\nimport java.io.*;\n\nimport org.jsoup.Connection;\nimport org.jsoup.Jsoup;\nimport org.jsoup.nodes.Document;\nimport play.Logger;\n\nclass FacebookSession {\n private static final String COOKIES_FILENAME = \"\/facebook_cookies\";\n\n private String cookies;\n\n FacebookSession() {\n InputStream secretsStream = getClass().getResourceAsStream(COOKIES_FILENAME);\n\n if (secretsStream == null) {\n Logger.warn(\"Cannot find Facebook cookies file \" + COOKIES_FILENAME);\n return;\n }\n\n try {\n cookies = IOUtils.toString(secretsStream, \"utf8\").trim();\n } catch (IOException e) {\n Logger.warn(\"Cannot open Facebook cookies file \" + COOKIES_FILENAME);\n }\n }\n\n Connection getConnection(String uri) {\n Connection c = Jsoup.connect(uri);\n c.header(\"cookie\", cookies);\n c.header(\"user-agent\", \"Mozilla\/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36\");\n return c;\n }\n\n Document getDocument(String uri) throws IOException {\n return getConnection(uri).execute().parse();\n }\n}\n","subject":"Fix Facebook crawler crashing app when no cookies file provided"} {"old_contents":"package com.github.cstroe.spendhawk.entity;\n\nimport com.github.cstroe.spendhawk.util.HibernateUtil;\nimport org.hibernate.criterion.Order;\nimport org.hibernate.criterion.Restrictions;\n\nimport java.util.List;\n\n\/**\n * The category for an expense. Categories are at the user level, so that\n * many accounts can use the same categories to categorize their expenditures.\n *\/\npublic class Category {\n private Long id;\n private User user;\n private String name;\n\n public Long getId() {\n return id;\n }\n\n public void setId(Long id) {\n this.id = id;\n }\n\n public User getUser() {\n return user;\n }\n\n public void setUser(User user) {\n this.user = user;\n }\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n\n public boolean save() {\n Long id = (Long) HibernateUtil.getSessionFactory().getCurrentSession().save(this);\n return id != null;\n }\n\n @SuppressWarnings(\"unchecked\")\n public static List findAll() {\n return (List) HibernateUtil.getSessionFactory().getCurrentSession()\n .createCriteria(Category.class)\n .addOrder(Order.asc(\"name\"))\n .list();\n }\n\n public static Category findById(Long id) {\n return (Category) HibernateUtil.getSessionFactory().getCurrentSession()\n .createCriteria(Category.class)\n .add(Restrictions.eq(\"id\", id))\n .uniqueResult();\n }\n\n}\n","new_contents":"package com.github.cstroe.spendhawk.entity;\n\nimport com.github.cstroe.spendhawk.util.HibernateUtil;\nimport org.hibernate.criterion.Order;\nimport org.hibernate.criterion.Restrictions;\n\nimport java.util.List;\n\n\/**\n * The category for an expense. Categories are at the user level, so that\n * many accounts can use the same categories to categorize their expenditures.\n *\/\npublic class Category {\n private Long id;\n private User user;\n private String name;\n\n public Long getId() {\n return id;\n }\n\n public void setId(Long id) {\n this.id = id;\n }\n\n public User getUser() {\n return user;\n }\n\n public void setUser(User user) {\n this.user = user;\n }\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n\n public boolean save() {\n Long id = (Long) HibernateUtil.getSessionFactory().getCurrentSession().save(this);\n return id != null;\n }\n\n public void delete() {\n HibernateUtil.getSessionFactory().getCurrentSession().delete(this);\n }\n\n @SuppressWarnings(\"unchecked\")\n public static List findAll() {\n return (List) HibernateUtil.getSessionFactory().getCurrentSession()\n .createCriteria(Category.class)\n .addOrder(Order.asc(\"name\"))\n .list();\n }\n\n public static Category findById(Long id) {\n return (Category) HibernateUtil.getSessionFactory().getCurrentSession()\n .createCriteria(Category.class)\n .add(Restrictions.eq(\"id\", id))\n .uniqueResult();\n }\n\n}\n","subject":"Add method to delete a category."} {"old_contents":"package net.darkmorford.btweagles.block;\n\nimport net.darkmorford.btweagles.BetterThanWeagles;\nimport net.minecraft.block.Block;\nimport net.minecraft.block.material.Material;\nimport net.minecraft.client.renderer.block.model.ModelResourceLocation;\nimport net.minecraft.creativetab.CreativeTabs;\nimport net.minecraft.item.Item;\nimport net.minecraftforge.client.model.ModelLoader;\nimport net.minecraftforge.fml.relauncher.Side;\nimport net.minecraftforge.fml.relauncher.SideOnly;\n\npublic class BlockButter extends Block\n{\n\tpublic BlockButter()\n\t{\n\t\tsuper(Material.CLAY);\n\n\t\tsetRegistryName(BetterThanWeagles.MODID, \"butter\");\n\t\tsetUnlocalizedName(\"butter\");\n\t\tsetCreativeTab(BetterThanWeagles.tabBTWeagles);\n\t}\n\n\t@SideOnly(Side.CLIENT)\n\tpublic void initModel()\n\t{\n\t\tModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), \"inventory\"));\n\t}\n}\n","new_contents":"package net.darkmorford.btweagles.block;\n\nimport net.darkmorford.btweagles.BetterThanWeagles;\nimport net.minecraft.block.Block;\nimport net.minecraft.block.material.Material;\nimport net.minecraft.client.renderer.block.model.ModelResourceLocation;\nimport net.minecraft.creativetab.CreativeTabs;\nimport net.minecraft.item.Item;\nimport net.minecraftforge.client.model.ModelLoader;\nimport net.minecraftforge.fml.relauncher.Side;\nimport net.minecraftforge.fml.relauncher.SideOnly;\n\npublic class BlockButter extends Block\n{\n\tpublic BlockButter()\n\t{\n\t\tsuper(Material.CLAY);\n\n\t\tthis.slipperiness = 0.98F;\n\n\t\tsetRegistryName(BetterThanWeagles.MODID, \"butter\");\n\t\tsetUnlocalizedName(\"butter\");\n\t\tsetCreativeTab(BetterThanWeagles.tabBTWeagles);\n\t}\n\n\t@SideOnly(Side.CLIENT)\n\tpublic void initModel()\n\t{\n\t\tModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), \"inventory\"));\n\t}\n}\n","subject":"Make butter blocks slippery like ice."} {"old_contents":"package com.adms.test;\r\n\r\n\r\n\r\npublic class TestApp {\r\n\r\n\tpublic static void main(String[] args) {\r\n\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"start\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"finish\");\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}\r\n}\r\n","new_contents":"package com.adms.test;\r\n\r\nimport java.util.Arrays;\r\nimport java.util.Calendar;\r\n\r\nimport com.adms.utils.DateUtil;\r\n\r\n\r\n\r\npublic class TestApp {\r\n\r\n\tpublic static void main(String[] args) {\r\n\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"start\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t\tSystem.out.println(DateUtil.convDateToString(\"MMM_yyyyMM\", cal.getTime()));\r\n\t\t\t\r\n\t\t\tString[] plan1s = new String[]{\"PLAN 1\", \"600000\"};\r\n\t\t\t\r\n\t\t\tString planVal = \"40000-Plan 1\";\r\n\t\t\t\r\n\t\t\tSystem.out.println(Arrays.binarySearch(plan1s, planVal.toUpperCase()));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"finish\");\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}\r\n}\r\n","subject":"Add method - Create Directory"} {"old_contents":"package de.gernd.simplemon.endpoints;\n\nimport de.gernd.simplemon.endpoints.model.AddSiteToMonitorRequest;\nimport de.gernd.simplemon.endpoints.model.GetMonitoredSitesResponse;\nimport de.gernd.simplemon.service.SimpleMonitoringService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\n\nimport javax.ws.rs.*;\nimport javax.ws.rs.core.Response;\nimport java.util.List;\n\n@Component\n@Path(\"\/monitored-sites\")\n@Produces(\"application\/json\")\n@Consumes(\"application\/json\")\npublic class SimpleMonitoringEndpoint {\n\n @Autowired\n private SimpleMonitoringService monitoringService;\n\n\n \/**\n * Method for retrieving all currently monitored sites\n *\n * @return All currently monitored sites\n *\/\n @Path(\"\/\")\n @GET\n public Response monitor() {\n GetMonitoredSitesResponse response = new GetMonitoredSitesResponse();\n List monitoredSites = monitoringService.getMonitoredSites();\n response.monitoredSites = monitoredSites;\n return Response.ok(monitoredSites).build();\n }\n\n \/**\n * Method for retrieving all currently monitored sites\n *\/\n @Path(\"\/\")\n @POST\n public Response addSite(AddSiteToMonitorRequest addSiteToMonitorRequest){\n monitoringService.startMonitoring(addSiteToMonitorRequest.url);\n return Response.ok().build();\n }\n}\n","new_contents":"package de.gernd.simplemon.endpoints;\n\nimport de.gernd.simplemon.endpoints.model.AddSiteToMonitorRequest;\nimport de.gernd.simplemon.endpoints.model.GetMonitoredSitesResponse;\nimport de.gernd.simplemon.service.SimpleMonitoringService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\n\nimport javax.ws.rs.*;\nimport javax.ws.rs.core.Response;\nimport java.util.List;\n\n@Component\n@Path(\"\/monitored-sites\")\n@Produces(\"application\/json\")\n@Consumes(\"application\/json\")\npublic class SimpleMonitoringEndpoint {\n\n @Autowired\n private SimpleMonitoringService monitoringService;\n\n\n \/**\n * Method for retrieving all currently monitored sites\n *\n * @return All currently monitored sites\n *\/\n @Path(\"\/\")\n @GET\n public Response getMonitoredSites() {\n GetMonitoredSitesResponse response = new GetMonitoredSitesResponse();\n List monitoredSites = monitoringService.getMonitoredSites();\n response.monitoredSites = monitoredSites;\n return Response.ok(monitoredSites).build();\n }\n\n \/**\n * Method for retrieving all currently monitored sites\n *\/\n @Path(\"\/\")\n @POST\n public Response addSite(AddSiteToMonitorRequest addSiteToMonitorRequest){\n monitoringService.startMonitoring(addSiteToMonitorRequest.url);\n return Response.ok().build();\n }\n\n\n}\n","subject":"Fix method name for getting the monitored sites"} {"old_contents":"\/**\n * Copyright 2010 The ForPlay Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License. \n *\/\npackage forplay.core;\n\n\/**\n * Generic platform interface. New platforms are defined as implementations of this interface.\n *\/\npublic interface Platform {\n\n Audio audio();\n\n Graphics graphics();\n \n AssetManager assetManager();\n\n Json json();\n\n Keyboard keyboard();\n\n Log log();\n\n Net net();\n\n Pointer pointer();\n\n \/**\n * Return the mouse if it is supported, or null otherwise.\n * \n * @return the mouse if it is supported, or null otherwise.\n *\/\n Mouse mouse();\n\n Storage storage();\n \n Analytics analytics();\n\n float random();\n\n void run(Game game);\n\n double time();\n\n RegularExpression regularExpression();\n\n void openURL(String url);\n}\n","new_contents":"\/**\n * Copyright 2010 The ForPlay Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License. \n *\/\npackage forplay.core;\n\n\/**\n * Generic platform interface. New platforms are defined as implementations of this interface.\n *\/\npublic interface Platform {\n\n Audio audio();\n\n Graphics graphics();\n \n AssetManager assetManager();\n\n Json json();\n\n Keyboard keyboard();\n\n Log log();\n\n Net net();\n\n Pointer pointer();\n\n Mouse mouse();\n\n Storage storage();\n \n Analytics analytics();\n\n float random();\n\n void run(Game game);\n\n double time();\n\n RegularExpression regularExpression();\n\n void openURL(String url);\n}\n","subject":"Remove useless comment about returning a null mouse. Access mouse through ForPlay.mouse()."} {"old_contents":"package ganymedes01.etfuturum.dispenser;\n\nimport ganymedes01.etfuturum.entities.EntityTippedArrow;\nimport ganymedes01.etfuturum.items.TippedArrow;\nimport net.minecraft.dispenser.BehaviorDefaultDispenseItem;\nimport net.minecraft.dispenser.BehaviorProjectileDispense;\nimport net.minecraft.dispenser.IBlockSource;\nimport net.minecraft.dispenser.IPosition;\nimport net.minecraft.entity.IProjectile;\nimport net.minecraft.item.ItemStack;\nimport net.minecraft.world.World;\n\npublic class DispenserBehaviourTippedArrow extends BehaviorDefaultDispenseItem {\n\n\t@Override\n\tpublic ItemStack dispenseStack(IBlockSource block, ItemStack stack) {\n\t\treturn new BehaviorProjectileDispense() {\n\n\t\t\t@Override\n\t\t\tprotected IProjectile getProjectileEntity(World world, IPosition pos) {\n\t\t\t\tEntityTippedArrow entity = new EntityTippedArrow(world, pos.getX(), pos.getY(), pos.getZ());\n\t\t\t\tentity.setEffect(TippedArrow.getEffect(stack));\n\t\t\t\treturn entity;\n\t\t\t}\n\t\t}.dispense(block, stack);\n\t}\n\n\t@Override\n\tprotected void playDispenseSound(IBlockSource block) {\n\t\tblock.getWorld().playAuxSFX(1002, block.getXInt(), block.getYInt(), block.getZInt(), 0);\n\t}\n}","new_contents":"package ganymedes01.etfuturum.dispenser;\n\nimport ganymedes01.etfuturum.entities.EntityTippedArrow;\nimport ganymedes01.etfuturum.items.TippedArrow;\nimport net.minecraft.dispenser.BehaviorDefaultDispenseItem;\nimport net.minecraft.dispenser.BehaviorProjectileDispense;\nimport net.minecraft.dispenser.IBlockSource;\nimport net.minecraft.dispenser.IPosition;\nimport net.minecraft.entity.IProjectile;\nimport net.minecraft.item.ItemStack;\nimport net.minecraft.world.World;\n\npublic class DispenserBehaviourTippedArrow extends BehaviorDefaultDispenseItem {\n\n\t@Override\n\tpublic ItemStack dispenseStack(IBlockSource block, ItemStack stack) {\n\t\treturn new BehaviorProjectileDispense() {\n\n\t\t\t@Override\n\t\t\tprotected IProjectile getProjectileEntity(World world, IPosition pos) {\n\t\t\t\tEntityTippedArrow entity = new EntityTippedArrow(world, pos.getX(), pos.getY(), pos.getZ());\n\t\t\t\tentity.canBePickedUp = 1;\n\t\t\t\tentity.setEffect(TippedArrow.getEffect(stack));\n\t\t\t\treturn entity;\n\t\t\t}\n\t\t}.dispense(block, stack);\n\t}\n\n\t@Override\n\tprotected void playDispenseSound(IBlockSource block) {\n\t\tblock.getWorld().playAuxSFX(1002, block.getXInt(), block.getYInt(), block.getZInt(), 0);\n\t}\n}","subject":"Fix tipped arrows not being pick-upable after shot out of a dispenser"} {"old_contents":"package com.example.crystalgame;\n\n\nimport com.example.crystalgame.communication.CommunicationService;\n\nimport android.os.Bundle;\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.view.Menu;\n\npublic class MainActivity extends Activity {\n\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tgetApplicationContext().startService(new Intent(getBaseContext(), CommunicationService.class));\n\t\tsetContentView(R.layout.activity_main);\n\t}\n\t\n\n\t@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\/\/ Inflate the menu; this adds items to the action bar if it is present.\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn true;\n\t}\n\n}\n","new_contents":"package com.example.crystalgame;\n\n\nimport com.example.crystalgame.communication.CommunicationService;\n\nimport android.os.Bundle;\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.util.Log;\nimport android.view.Menu;\n\npublic class MainActivity extends Activity {\n\n\tprivate Intent communicationIntent;\n\t\n\t@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\/\/ Inflate the menu; this adds items to the action bar if it is present.\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn true;\n\t}\n\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_main);\n\t}\n\t\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\n\t\tLog.d(\"CommunicationService\", \"oncreate\");\n\t\tcommunicationIntent = createCommunictionIntent();\n\t\tgetApplicationContext().startService(communicationIntent);\n\t}\n \n \/\/protected void onRestart();\n\n \/\/protected void onResume();\n\n \/\/protected void onPause();\n\n protected void onStop() {\n \tgetApplicationContext().stopService(communicationIntent);\n }\n\n \/\/protected void onDestroy();\n\t\n \n private Intent createCommunictionIntent() {\n \treturn new Intent(getBaseContext(), CommunicationService.class);\n }\n}\n","subject":"Move the service creation to onStart, add onStop service termination"} {"old_contents":"package info.u_team.u_team_core.item.tool;\n\nimport info.u_team.u_team_core.api.registry.IUArrayRegistryType;\nimport net.minecraft.item.Item;\n\npublic class ToolSet implements IUArrayRegistryType {\n\t\n\tprivate final UAxeItem axe;\n\tprivate final UHoeItem hoe;\n\tprivate final UPickaxeItem pickaxe;\n\tprivate final UShovelItem spade;\n\tprivate final USwordItem sword;\n\t\n\tpublic ToolSet(UAxeItem axe, UHoeItem hoe, UPickaxeItem pickaxe, UShovelItem spade, USwordItem sword) {\n\t\tthis.axe = axe;\n\t\tthis.hoe = hoe;\n\t\tthis.pickaxe = pickaxe;\n\t\tthis.spade = spade;\n\t\tthis.sword = sword;\n\t}\n\t\n\t@Override\n\tpublic Item[] getArray() {\n\t\treturn new Item[] { axe, hoe, pickaxe, spade, sword };\n\t}\n\t\n\tpublic UAxeItem getAxe() {\n\t\treturn axe;\n\t}\n\t\n\tpublic UHoeItem getHoe() {\n\t\treturn hoe;\n\t}\n\t\n\tpublic UPickaxeItem getPickaxe() {\n\t\treturn pickaxe;\n\t}\n\t\n\tpublic UShovelItem getSpade() {\n\t\treturn spade;\n\t}\n\t\n\tpublic USwordItem getSword() {\n\t\treturn sword;\n\t}\n\t\n}\n","new_contents":"package info.u_team.u_team_core.item.tool;\n\nimport info.u_team.u_team_core.api.registry.IUArrayRegistryType;\nimport net.minecraft.item.Item;\n\npublic class ToolSet implements IUArrayRegistryType {\n\t\n\tprivate final UAxeItem axe;\n\tprivate final UHoeItem hoe;\n\tprivate final UPickaxeItem pickaxe;\n\tprivate final UShovelItem shovel;\n\tprivate final USwordItem sword;\n\t\n\tpublic ToolSet(UAxeItem axe, UHoeItem hoe, UPickaxeItem pickaxe, UShovelItem shovel, USwordItem sword) {\n\t\tthis.axe = axe;\n\t\tthis.hoe = hoe;\n\t\tthis.pickaxe = pickaxe;\n\t\tthis.shovel = shovel;\n\t\tthis.sword = sword;\n\t}\n\t\n\t@Override\n\tpublic Item[] getArray() {\n\t\treturn new Item[] { axe, hoe, pickaxe, shovel, sword };\n\t}\n\t\n\tpublic UAxeItem getAxe() {\n\t\treturn axe;\n\t}\n\t\n\tpublic UHoeItem getHoe() {\n\t\treturn hoe;\n\t}\n\t\n\tpublic UPickaxeItem getPickaxe() {\n\t\treturn pickaxe;\n\t}\n\t\n\tpublic UShovelItem getShovel() {\n\t\treturn shovel;\n\t}\n\t\n\tpublic USwordItem getSword() {\n\t\treturn sword;\n\t}\n\t\n}\n","subject":"Rename all spade variable names to shovel variable names"} {"old_contents":"package com.boundary.plugin.sdk;\n\npublic class Dashboard {\n\t\n\t\n}\n","new_contents":"\/\/ Copyright 2014 Boundary, Inc.\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.boundary.plugin.sdk;\n\n\/**\n * Data structure the represents a dashboard in the plugin.json<\/code> plugin manifest\n * \n *
\n * \"dashboards\" : [\n        { \"name\": \"Plugin Shell\", \"layout\": \"d-w=3&d-h=2&d-pad=5&d-bg=none&d-g-BOUNDARY_PORT_AVAILABILITY=0-1-1-1&d-g-BOUNDARY_RANDOM_NUMBER=0-0-1-1&d-g-BOUNDARY_PROCESS_COUNT=1-0-1-1&d-g-BOUNDARY_FILE_SPACE_CAPACITY=2-0-1-1&d-g-BOUNDARY_PORT_RESPONSE=1-1-1-1\"},\n        { \"name\": \"CPU Load\", \"layout\":\"d-w=1&d-h=3&d-pad=5&d-bg=none&d-g-BOUNDARY_CPU_LOAD_1_MINUTE=0-0-1-1&d-g-BOUNDARY_CPU_LOAD_5_MINUTE=0-1-1-1&d-g-BOUNDARY_CPU_LOAD_15_MINUTE=0-2-1-1\"}\n    ]\n * <\/pre>\n *\n *\/\npublic class Dashboard {\n\tString name;\n\tString layout;\n}\n","subject":"Add fields; license ; and javadoc"}
{"old_contents":"package info.u_team.u_team_test2;\n\nimport org.apache.logging.log4j.*;\n\nimport info.u_team.u_team_core.construct.ConstructManager;\nimport info.u_team.u_team_core.integration.IntegrationManager;\nimport info.u_team.u_team_core.util.verify.JarSignVerifier;\nimport net.minecraftforge.fml.common.Mod;\n\n@Mod(TestMod2.MODID)\npublic class TestMod2 {\n\t\n\tpublic static final String MODID = \"uteamtest2\";\n\tpublic static final Logger LOGGER = LogManager.getLogger(\"UTeamTest2\");\n\t\n\tpublic TestMod2() {\n\t\tJarSignVerifier.checkSigned(MODID);\n\t\t\n\t\tLOGGER.info(\"-------------------------------------- LOADING TEST MOD 2 -------------------------------------\");\n\t\t\n\t\tConstructManager.constructConstructs(MODID);\n\t\tIntegrationManager.constructIntegrations(MODID);\n\t}\n}\n","new_contents":"package info.u_team.u_team_test2;\n\nimport org.apache.logging.log4j.*;\n\nimport info.u_team.u_team_core.util.annotation.AnnotationManager;\nimport info.u_team.u_team_core.util.verify.JarSignVerifier;\nimport net.minecraftforge.fml.common.Mod;\n\n@Mod(TestMod2.MODID)\npublic class TestMod2 {\n\t\n\tpublic static final String MODID = \"uteamtest2\";\n\tpublic static final Logger LOGGER = LogManager.getLogger(\"UTeamTest2\");\n\t\n\tpublic TestMod2() {\n\t\tJarSignVerifier.checkSigned(MODID);\n\t\t\n\t\tLOGGER.info(\"-------------------------------------- LOADING TEST MOD 2 -------------------------------------\");\n\t\t\n\t\tAnnotationManager.callAnnotations(MODID);\n\t}\n}\n","subject":"Update testmod 2 to use the new method"}
{"old_contents":"package io.jahed.twitchrobot;\n\nimport java.util.List;\n\nimport org.pircbotx.PircBotX;\nimport org.pircbotx.ServerInfo;\n\npublic class TwitchServerInfo extends ServerInfo {\n\n\tpublic TwitchServerInfo(PircBotX bot) {\n\t\tsuper(bot);\n\t}\n\t\n\t@Override\n\tpublic void parse(int code, List parsedLine) {\n\t\t\/\/Library assumes too much.\n\t\tif(code == 4 && parsedLine.size() < 2) {\n\t\t\tSystem.err.println(\"TwitchServerInfo - Code 4 with \" + parsedLine);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tsuper.parse(code, parsedLine);\n\t}\n\n}\n","new_contents":"package io.jahed.twitchrobot;\n\nimport java.util.List;\n\nimport org.pircbotx.PircBotX;\nimport org.pircbotx.ServerInfo;\n\npublic class TwitchServerInfo extends ServerInfo {\n\n\tpublic TwitchServerInfo(PircBotX bot) {\n\t\tsuper(bot);\n\t}\n\t\n\t@Override\n\tpublic void parse(int code, List parsedLine) {\n\t\tif(code == 4 && parsedLine.size() < 2) {\n\t\t\t\/\/Twitch IRC Server has an extra Code 4 response containing user's nick.\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tsuper.parse(code, parsedLine);\n\t}\n\n}\n","subject":"Remove println for extra IRC handlers"}
{"old_contents":"package com.example.rxappfocus;\n\nimport android.app.Application;\nimport android.widget.Toast;\n\nimport com.gramboid.rxappfocus.AppFocusProvider;\n\nimport rx.functions.Action1;\n\npublic class App extends Application {\n\n    private AppFocusProvider focusProvider;\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        focusProvider = new AppFocusProvider(this);\n        focusProvider\n                .getAppFocus()\n                .subscribe(new Action1() {\n                    @Override\n                    public void call(Boolean visible) {\n                        Toast.makeText(App.this, visible ? \"App visible\" : \"App hidden\", Toast.LENGTH_SHORT).show();\n                    }\n                });\n    }\n\n    public AppFocusProvider getFocusProvider() {\n        return focusProvider;\n    }\n}\n","new_contents":"package com.example.rxappfocus;\n\nimport android.app.Application;\nimport android.widget.Toast;\n\nimport com.gramboid.rxappfocus.AppFocusProvider;\n\nimport rx.functions.Action1;\n\npublic class App extends Application {\n\n    private AppFocusProvider focusProvider;\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        focusProvider = new AppFocusProvider(this);\n\n        \/\/ show a toast every time the app becomes visible or hidden\n        focusProvider.getAppFocus()\n                .subscribe(new Action1() {\n                    @Override\n                    public void call(Boolean visible) {\n                        Toast.makeText(App.this, visible ? \"App visible\" : \"App hidden\", Toast.LENGTH_SHORT).show();\n                    }\n                });\n    }\n\n    public AppFocusProvider getFocusProvider() {\n        return focusProvider;\n    }\n}\n","subject":"Tidy up and add comment"}
{"old_contents":"package edu.northwestern.bioinformatics.studycalendar.domain;\n\nimport javax.persistence.Entity;\nimport javax.persistence.DiscriminatorValue;\nimport javax.persistence.Transient;\n\n\n\/**\n * @author Nataliya Shurupova\n *\/\n\n@Entity\n@DiscriminatorValue(value=\"2\")\npublic class DayOfTheWeek extends Holiday {\n    private String dayOfTheWeek;\n\n    @Transient\n    public String getDisplayName() {\n        return getDayOfTheWeek();\n    }\n\n    @Transient\n    public int getDayOfTheWeekInteger() {\n        return mapDayNameToInteger(getDayOfTheWeek());\n    }\n\n    public String getDayOfTheWeek() {\n        return this.dayOfTheWeek;\n    }\n\n    public void setDayOfTheWeek(String dayOfTheWeek) {\n        this.dayOfTheWeek = dayOfTheWeek;\n    }\n\n    @Override\n    public boolean equals(Object o) {\n        if (this == o) return true;\n        if (o == null || getClass() != o.getClass()) return false;\n\n        DayOfTheWeek that = (DayOfTheWeek) o;\n\n        if (dayOfTheWeek != null ? !dayOfTheWeek.equals(that.dayOfTheWeek) : that.dayOfTheWeek != null)\n            return false;\n\n        return true;\n    }\n\n    @Override\n    public String toString(){\n        StringBuffer sb = new StringBuffer();\n        sb.append(\"Id = \");\n        sb.append(getId());\n        sb.append(\" DayOfTheWeek = \");\n        sb.append(getDayOfTheWeek());\n        sb.append(super.toString());\n        return sb.toString();\n    }\n}\n\n\n","new_contents":"package edu.northwestern.bioinformatics.studycalendar.domain;\n\nimport javax.persistence.Entity;\nimport javax.persistence.DiscriminatorValue;\nimport javax.persistence.Transient;\n\n\n\/**\n * @author Nataliya Shurupova\n *\/\n\n@Entity\n@DiscriminatorValue(value=\"2\")\npublic class DayOfTheWeek extends Holiday {\n    \/\/ TODO: This ought to be the java.util.Calendar constant for the day, or a custom enum\n    private String dayOfTheWeek;\n\n    @Transient\n    public String getDisplayName() {\n        return getDayOfTheWeek();\n    }\n\n    @Transient\n    public int getDayOfTheWeekInteger() {\n        return mapDayNameToInteger(getDayOfTheWeek());\n    }\n\n    public String getDayOfTheWeek() {\n        return this.dayOfTheWeek;\n    }\n\n    public void setDayOfTheWeek(String dayOfTheWeek) {\n        this.dayOfTheWeek = dayOfTheWeek;\n    }\n\n    @Override\n    public boolean equals(Object o) {\n        if (this == o) return true;\n        if (o == null || getClass() != o.getClass()) return false;\n\n        DayOfTheWeek that = (DayOfTheWeek) o;\n\n        if (dayOfTheWeek != null ? !dayOfTheWeek.equals(that.dayOfTheWeek) : that.dayOfTheWeek != null)\n            return false;\n\n        return true;\n    }\n\n    @Override\n    public String toString(){\n        StringBuffer sb = new StringBuffer();\n        sb.append(\"Id = \");\n        sb.append(getId());\n        sb.append(\" DayOfTheWeek = \");\n        sb.append(getDayOfTheWeek());\n        sb.append(super.toString());\n        return sb.toString();\n    }\n}\n\n\n","subject":"Add TODO about using an enum instead of an unconstrained string"}
{"old_contents":"\/* Generated By:JJTree: Do not edit this line. ASTJexlScript.java *\/\n\npackage org.apache.commons.jexl.parser;\n\n\/**\n * Top of the syntax tree - parsed Jexl code.\n *\/\npublic class ASTJexlScript extends SimpleNode {\n  public ASTJexlScript(int id) {\n    super(id);\n  }\n\n  public ASTJexlScript(Parser p, int id) {\n    super(p, id);\n  }\n\n\n  \/** Accept the visitor. **\/\n  public Object jjtAccept(ParserVisitor visitor, Object data) {\n    return visitor.visit(this, data);\n  }\n}\n","new_contents":"\/* Generated By:JJTree: Do not edit this line. ASTJexlScript.java *\/\n\npackage org.apache.commons.jexl.parser;\n\nimport org.apache.commons.jexl.JexlContext;\n\n\/**\n * Top of the syntax tree - parsed Jexl code.\n * @since 1.1\n *\/\npublic class ASTJexlScript extends SimpleNode {\n  public ASTJexlScript(int id) {\n    super(id);\n  }\n\n  public ASTJexlScript(Parser p, int id) {\n    super(p, id);\n  }\n\n\n  \/** Accept the visitor. **\/\n  public Object jjtAccept(ParserVisitor visitor, Object data) {\n    return visitor.visit(this, data);\n  }\n  \n  public Object value(JexlContext jc) throws Exception\n  {\n      SimpleNode child = (SimpleNode)jjtGetChild(0);\n      return child.value(jc);\n  }\n}\n","subject":"Add value(context) method to support scripts"}
{"old_contents":"package com.nulabinc.zxcvbn.matchers;\n\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\npublic class Dictionary {\n\n    private final String name;\n\n    private final List frequencies;\n\n    private final Map rankedDictionary;\n\n    public Dictionary(String name, List frequencies) {\n        this.name = name;\n        this.frequencies = frequencies;\n        this.rankedDictionary = toRankedDictionary(frequencies);\n    }\n\n    private Map toRankedDictionary(final List frequencies) {\n        Map result = new HashMap<>();\n        int i = 1; \/\/ rank starts at 1, not 0\n        for (String word : frequencies) {\n            result.put(word, i);\n            i++;\n        }\n        return result;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public List getFrequencies() {\n        return frequencies;\n    }\n\n    public Map getRankedDictionary() {\n        return rankedDictionary;\n    }\n}","new_contents":"package com.nulabinc.zxcvbn.matchers;\n\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\npublic class Dictionary {\n\n    private final String name;\n\n    private final List frequencies;\n\n    private final Map rankedDictionary;\n\n    public Dictionary(String name, List frequencies) {\n        this.name = name;\n        this.frequencies = frequencies;\n        this.rankedDictionary = toRankedDictionary(frequencies);\n    }\n\n    private Map toRankedDictionary(final List frequencies) {\n        Map result = new HashMap<>();\n        int i = 1; \/\/ rank starts at 1, not 0\n        for (String word : frequencies) {\n            result.put(word, i);\n            i++;\n        }\n        return result;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public List getFrequencies() {\n        return frequencies;\n    }\n\n    public Map getRankedDictionary() {\n        return rankedDictionary;\n    }\n}\n","subject":"Add newline to follow a POSIX rule."}
{"old_contents":"package com.xrtb.exchanges;\n\nimport java.io.InputStream;\nimport com.xrtb.pojo.BidRequest;\n\n\/**\n * A class to handle Epom ad exchange\n * @author Ben M. Faul\n *\n *\/\n\npublic class Epom extends BidRequest {\n\n        public Epom() {\n                super();\n                parseSpecial();\n        }\n        \n        \/**\n         * Make a Epom bid request using a String.\n         * @param in String. The JSON bid request for Epom\n         * @throws Exception on JSON errors.\n         *\/\n        public Epom(String  in) throws Exception  {\n                super(in);\n                parseSpecial();\n    }\n\n        \/**\n         * Make a Epom bid request using an input stream.\n         * @param in InputStream. The contents of a HTTP post.\n         * @throws Exception on JSON errors.\n         *\/\n        public Epom(InputStream in) throws Exception {\n                super(in);\n                parseSpecial();\n        }\n        \n        \/**\n         * Process special Epom stuff, sets the exchange name.\n         *\/\n        @Override\n        public boolean parseSpecial() {\n                exchange = \"epom\";\n                return true;\n        }\n}\n\n\n\n        \n","new_contents":"package com.xrtb.exchanges;\n\nimport java.io.InputStream;\nimport com.xrtb.pojo.BidRequest;\n\n\/**\n * A class to handle Epom ad exchange\n * @author Ben M. Faul\n *\n *\/\n\npublic class Epom extends BidRequest {\n\n        public Epom() {\n                super();\n                parseSpecial();\n        }\n        \n        \/**\n         * Make a Epom bid request using a String.\n         * @param in String. The JSON bid request for Epom\n         * @throws Exception on JSON errors.\n         *\/\n        public Epom(String  in) throws Exception  {\n                super(in);\n                parseSpecial();\n    }\n\n        \/**\n         * Make a Epom bid request using an input stream.\n         * @param in InputStream. The contents of a HTTP post.\n         * @throws Exception on JSON errors.\n         *\/\n        public Epom(InputStream in) throws Exception {\n                super(in);\n                parseSpecial();\n        }\n        \n        \/**\n         * Process special Epom stuff, sets the exchange name.\n         *\/\n        @Override\n        public boolean parseSpecial() {\n                exchange = \"epom\";\n                usesEncodedAdm = false;\n                return true;\n        }\n}\n\n\n\n        \n","subject":"Fix epom to not use encoded adm"}
{"old_contents":"package uk.ac.ebi.biosamples.accession;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.beans.factory.annotation.Qualifier;\nimport org.springframework.jdbc.core.JdbcTemplate;\nimport org.springframework.jdbc.core.RowCallbackHandler;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class AccessionDao {\n\n\tprivate Logger log = LoggerFactory.getLogger(getClass());\n\n\t@Autowired\n\t@Qualifier(\"accessionJdbcTemplate\")\n    protected JdbcTemplate jdbcTemplate;\n\n\tpublic void doAssayAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_ASSAY\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n\n\tpublic void doReferenceAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_REFERENCE\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n\n\tpublic void doGroupAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_GROUP\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n}\n","new_contents":"package uk.ac.ebi.biosamples.accession;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.beans.factory.annotation.Qualifier;\nimport org.springframework.jdbc.core.JdbcTemplate;\nimport org.springframework.jdbc.core.RowCallbackHandler;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class AccessionDao {\n\n\tprivate Logger log = LoggerFactory.getLogger(getClass());\n\n\t@Autowired\n\t@Qualifier(\"accessionJdbcTemplate\")\n    protected JdbcTemplate jdbcTemplate;\n\n\tpublic void doAssayAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_ASSAY\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n\n\tpublic void doReferenceAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_REFERENCE\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n\n\tpublic void doGroupAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_GROUPS\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n}\n","subject":"Tweak to fix sql table name"}
{"old_contents":"package controller;\n\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\n\nimport javax.swing.JButton;\n\nimport model.Message;\nimport view.MessageBoard;\n\npublic class MessageBoardController implements ActionListener{\n\tprivate Controller controller;\n\t\n\tpublic MessageBoardController(Controller controller) {\n\t\tthis.controller = controller;\n\t}\n\t\n\t@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tMessageBoard messageBoard =(MessageBoard)((JButton)e.getSource()).getParent();\n\t\t\/\/System.out.println(\"Send this message: \"+messageBoard.getMessage()+\" to: \"+messageBoard.getUser().getUserName());\n\t\tString mess = messageBoard.getMessage();\n\t\tSystem.out.println(\"in controller \"+mess);\n\t\tMessage messageToServet = new Message(messageBoard.getUser().getUserName(),mess);\n\t\tMessage messageToDoc = new Message(controller.getModel().getAuthUser().getUserName(),mess);\n\t\tmessageToDoc.printMessage(messageBoard.getUser().getDoc());\n\t\tcontroller.getServerHandler().sendMessage(messageToServet);\n\t}\n\n}\n","new_contents":"package controller;\n\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\n\nimport javax.swing.JButton;\n\nimport model.Message;\nimport view.MessageBoard;\n\npublic class MessageBoardController implements ActionListener{\n\tprivate Controller controller;\n\t\n\tpublic MessageBoardController(Controller controller) {\n\t\tthis.controller = controller;\n\t}\n\t\n\t@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tMessageBoard messageBoard =(MessageBoard)((JButton)e.getSource()).getParent();\n\t\t\/\/System.out.println(\"Send this message: \"+messageBoard.getMessage()+\" to: \"+messageBoard.getUser().getUserName());\n\t\tString mess = messageBoard.getMessage();\n\t\tif(!mess.equals(\"\")){\n\t\t\tSystem.out.println(\"in controller \"+mess);\n\t\t\tMessage messageToServet = new Message(messageBoard.getUser().getUserName(),mess);\n\t\t\tMessage messageToDoc = new Message(controller.getModel().getAuthUser().getUserName(),mess);\n\t\t\tmessageToDoc.printMessage(messageBoard.getUser().getDoc());\n\t\t\tcontroller.getServerHandler().sendMessage(messageToServet);\n\t\t}\n\t}\n\n}\n","subject":"Fix Client Send Empty message"}
{"old_contents":"package bd.basic.nodes;\n\nimport com.oracle.truffle.api.nodes.Node;\n\n\n\/**\n * Dummy Node to work around Truffle's restriction that a node, which is going to\n * be instrumented, needs to have a parent.\n *\/\npublic final class DummyParent extends Node {\n  @Child public Node child;\n\n  public DummyParent(final Node node) {\n    this.child = insert(node);\n  }\n}\n","new_contents":"package bd.basic.nodes;\n\nimport com.oracle.truffle.api.nodes.Node;\n\n\n\/**\n * Dummy Node to work around Truffle's restriction that a node, which is going to\n * be instrumented, needs to have a parent.\n *\/\npublic final class DummyParent extends Node {\n  @Child public Node child;\n\n  public DummyParent(final Node node) {\n    this.child = insert(node);\n  }\n\n  public void notifyInserted() {\n    super.notifyInserted(child);\n  }\n}\n","subject":"Add helper to allow dynamic instrumentation wrappers to be inserted"}
{"old_contents":"package seedu.address.commons.events.ui;\n\nimport seedu.address.commons.events.BaseEvent;\nimport seedu.address.model.person.ReadOnlyPerson;\n\n\/**\n * Represents a selection change in the Person List Panel\n *\/\npublic class PersonPanelSelectionChangedEvent extends BaseEvent {\n\n\n    private final ReadOnlyPerson newSelection;\n\n    public PersonPanelSelectionChangedEvent(ReadOnlyPerson newSelection){\n        this.newSelection = newSelection;\n    }\n\n    @Override\n    public String toString() {\n        return this.getClass().getSimpleName();\n    }\n\n    public ReadOnlyPerson getNewSelection() {\n        return newSelection;\n    }\n}\n","new_contents":"package seedu.address.commons.events.ui;\n\nimport seedu.address.commons.events.BaseEvent;\nimport seedu.address.model.activity.Activity;\nimport seedu.address.model.person.ReadOnlyPerson;\n\n\/**\n * Represents a selection change in the Person List Panel\n *\/\npublic class PersonPanelSelectionChangedEvent extends BaseEvent {\n\n\n    private final Activity newSelection;\n\n    public PersonPanelSelectionChangedEvent(Activity newValue){\n        this.newSelection = newValue;\n    }\n\n    @Override\n    public String toString() {\n        return this.getClass().getSimpleName();\n    }\n\n    public Activity getNewSelection() {\n        return newSelection;\n    }\n}\n","subject":"Update selection event to activity"}
{"old_contents":"package org.zeromq.czmq;\n\npublic class ZFrame implements AutoCloseable {\n\n    long pointer;\n\n    public ZFrame() {\n        pointer = __init();\n    }\n\n    public ZFrame(long address) {\n        pointer = address;\n    }\n\n    public ZFrame(byte[] buf, long size) {\n        pointer = __init(buf, size);\n    }\n    native static long __init();\n\n    native static long __init(byte[] buf, long size);\n\n    native static void __destroy(long pointer);\n\n    @Override\n    public void close() {\n        __destroy(pointer);\n        pointer = 0;\n    }\n}\n","new_contents":"package org.zeromq.czmq;\n\npublic class ZFrame implements AutoCloseable {\n\n    long pointer;\n\n    public ZFrame() {\n        pointer = ZFrame.__init();\n    }\n\n    public ZFrame(long address) {\n        pointer = address;\n    }\n\n    public ZFrame(byte[] buf, long size) {\n        pointer = ZFrame.__init(buf, size);\n    }\n\n    public long size() {\n        return ZFrame.__size(pointer);\n    }\n    native static long __init();\n\n    native static long __init(byte[] buf, long size);\n\n    native static void __destroy(long pointer);\n\n    native static long __size(long pointer);\n\n    @Override\n    public void close() {\n        ZFrame.__destroy(pointer);\n        pointer = 0;\n    }\n}\n","subject":"Call from the static context"}
{"old_contents":"package com.google.sitebricks.options;\n\nimport com.google.common.collect.Lists;\nimport com.google.common.collect.Sets;\nimport com.google.inject.Inject;\nimport com.google.sitebricks.conversion.MvelTypeConverter;\nimport com.google.sitebricks.conversion.TypeConverter;\n\nimport java.lang.reflect.Type;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n\/**\n * Hacky wrapper of MvelTypeConverter to support sets.\n *\n * @author jochen@pedesis.org (Jochen Bekmann)\n *\/\npublic class OptionTypeConverter implements TypeConverter {\n  @Inject\n  MvelTypeConverter converter;\n\n  @Override\n  @SuppressWarnings(\"unchecked\")\n  public  T convert(Object source, Type type) {\n    if (Set.class == type && String.class == source.getClass()) {\n      Set set = Sets.newHashSet();\n      for (String s : ((String) source).split(\",\"))\n        set.add(s.trim());\n      return (T) set;\n    }\n    return converter.convert(source, type);\n  }\n}\n","new_contents":"package com.google.sitebricks.options;\n\nimport java.lang.reflect.Type;\nimport java.util.Set;\n\nimport com.google.common.collect.Sets;\nimport com.google.inject.Inject;\nimport com.google.sitebricks.conversion.MvelTypeConverter;\nimport com.google.sitebricks.conversion.TypeConverter;\n\n\/**\n * Hacky wrapper of MvelTypeConverter to support sets.\n *\n * @author jochen@pedesis.org (Jochen Bekmann)\n *\/\npublic class OptionTypeConverter implements TypeConverter {\n  @Inject\n  MvelTypeConverter converter;\n\n  @Override\n  @SuppressWarnings(\"unchecked\")\n  public  T convert(Object source, Type type) {\n    if (Set.class == type && String.class == source.getClass()) {\n      Set set = Sets.newHashSet();\n      for (String s : ((String) source).split(\",\"))\n        set.add(s.trim());\n      return (T) set;\n    }\n    return (T) converter.convert(source, type);\n  }\n}\n","subject":"Fix compilation issue due to bug in 'old' jdk 'Inference fails for type variable return constraint'"}
{"old_contents":"package de.uni_stuttgart.vis.vowl.owl2vowl.model.nodes.datatypes;\n\nimport de.uni_stuttgart.vis.vowl.owl2vowl.constants.Node_Types;\nimport de.uni_stuttgart.vis.vowl.owl2vowl.constants.Vowl_Lang;\nimport de.uni_stuttgart.vis.vowl.owl2vowl.export.JsonGeneratorVisitor;\n\npublic class RdfsLiteral extends BaseDatatype {\n\n\tpublic RdfsLiteral() {\n\t\tsetType(Node_Types.TYPE_LITERAL);\n\t\tsetID();\n\t\tgetLabels().put(Vowl_Lang.LANG_DEFAULT, \"Literal\");\n\t}\n\n\t@Override\n\tprotected void setID() {\n\t\tid = \"literal\" + counterObjects;\n\t\tcounterObjects++;\n\t}\n\n\t@Override\n\tpublic void accept(JsonGeneratorVisitor visitor) {\n\t\tsuper.accept(visitor);\n\t\tvisitor.visit(this);\n\t}\n}\n","new_contents":"package de.uni_stuttgart.vis.vowl.owl2vowl.model.nodes.datatypes;\n\nimport de.uni_stuttgart.vis.vowl.owl2vowl.constants.Node_Types;\nimport de.uni_stuttgart.vis.vowl.owl2vowl.constants.Standard_Iris;\nimport de.uni_stuttgart.vis.vowl.owl2vowl.constants.Vowl_Lang;\nimport de.uni_stuttgart.vis.vowl.owl2vowl.export.JsonGeneratorVisitor;\n\npublic class RdfsLiteral extends BaseDatatype {\n\n\tpublic RdfsLiteral() {\n\t\tsetType(Node_Types.TYPE_LITERAL);\n\t\tsetID();\n\t\tgetLabels().put(Vowl_Lang.LANG_DEFAULT, \"Literal\");\n\t\tsetIri(Standard_Iris.GENERIC_LITERAL_URI);\n\t}\n\n\t@Override\n\tprotected void setID() {\n\t\tid = \"literal\" + counterObjects;\n\t\tcounterObjects++;\n\t}\n\n\t@Override\n\tpublic void accept(JsonGeneratorVisitor visitor) {\n\t\tsuper.accept(visitor);\n\t\tvisitor.visit(this);\n\t}\n}\n","subject":"Set standard iri for literal."}
{"old_contents":"package com.imcode.configuration;\n\nimport com.imcode.services.GenericService;\nimport imcode.services.IvisServiceFactory;\nimport imcode.services.utils.IvisOAuth2Utils;\nimport org.springframework.core.MethodParameter;\nimport org.springframework.web.bind.support.WebArgumentResolver;\nimport org.springframework.web.context.request.NativeWebRequest;\n\nimport javax.servlet.http.HttpServletRequest;\n\n\/**\n * Created by ruslan on 06.12.16.\n *\/\npublic class IvisServiceArgumentResolver implements WebArgumentResolver {\n\n    @Override\n    public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) throws Exception {\n        Class type = methodParameter.getParameterType();\n        Object nativeRequest = webRequest.getNativeRequest();\n        if (!GenericService.class.isAssignableFrom(type) && !(nativeRequest instanceof HttpServletRequest)) {\n            return UNRESOLVED;\n        }\n\n        HttpServletRequest request = (HttpServletRequest) nativeRequest;\n        IvisServiceFactory ivisServiceFactory = IvisOAuth2Utils.getServiceFactory(request);\n\n        return ivisServiceFactory.getService((Class) type);\n\n    }\n\n}\n","new_contents":"package imcode.services.argumentresolver;\n\nimport com.imcode.services.GenericService;\nimport imcode.services.IvisServiceFactory;\nimport imcode.services.utils.IvisOAuth2Utils;\nimport org.springframework.core.MethodParameter;\nimport org.springframework.web.bind.support.WebArgumentResolver;\nimport org.springframework.web.context.request.NativeWebRequest;\n\nimport javax.servlet.http.HttpServletRequest;\n\n\/**\n * Created by ruslan on 06.12.16.\n *\/\npublic class IvisServiceArgumentResolver implements WebArgumentResolver {\n\n    @Override\n    public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) throws Exception {\n        Class type = methodParameter.getParameterType();\n        Object nativeRequest = webRequest.getNativeRequest();\n        if (!GenericService.class.isAssignableFrom(type) && !(nativeRequest instanceof HttpServletRequest)) {\n            return UNRESOLVED;\n        }\n\n        HttpServletRequest request = (HttpServletRequest) nativeRequest;\n        IvisServiceFactory ivisServiceFactory = IvisOAuth2Utils.getServiceFactory(request);\n\n        return ivisServiceFactory.getService((Class) type);\n\n    }\n\n}\n","subject":"Fix package name in argument resolver."}
{"old_contents":"package com.google.sitebricks.persist;\n\nimport com.google.inject.AbstractModule;\nimport com.google.inject.Key;\nimport com.google.inject.matcher.Matcher;\n\nimport java.lang.reflect.AnnotatedElement;\n\nimport static com.google.inject.matcher.Matchers.annotatedWith;\nimport static com.google.inject.matcher.Matchers.any;\n\n\/**\n * @author dhanji@gmail.com (Dhanji R. Prasanna)\n *\/\npublic final class PersistAopModule extends AbstractModule {\n  private final AbstractPersistenceModule module;\n\n  public PersistAopModule(AbstractPersistenceModule module) {\n    this.module = module;\n  }\n\n  @Override\n  protected void configure() {\n    Key persisterKey = module.selectorKey(Persister.class);\n    WorkInterceptor workInterceptor = new WorkInterceptor(persisterKey);\n    TransactionInterceptor transactionInterceptor = new TransactionInterceptor(persisterKey);\n    requestInjection(workInterceptor);\n    requestInjection(transactionInterceptor);\n\n    Matcher workMatcher = annotatedWith(Work.class);\n    Matcher txnMatcher = annotatedWith(Transactional.class);\n\n    \/\/ Visible persistence APIs.\n    if (module.selector != null) {\n      workMatcher.and(annotatedWith(module.selector));\n      txnMatcher.and(annotatedWith(module.selector));\n    }\n\n    bindInterceptor(any(), workMatcher, workInterceptor);\n    bindInterceptor(any(), txnMatcher, transactionInterceptor);\n  }\n}\n","new_contents":"package com.google.sitebricks.persist;\n\nimport com.google.inject.AbstractModule;\nimport com.google.inject.Key;\nimport com.google.inject.matcher.Matcher;\n\nimport java.lang.reflect.AnnotatedElement;\n\nimport static com.google.inject.matcher.Matchers.annotatedWith;\nimport static com.google.inject.matcher.Matchers.any;\n\n\/**\n * @author dhanji@gmail.com (Dhanji R. Prasanna)\n *\/\npublic final class PersistAopModule extends AbstractModule {\n  private final AbstractPersistenceModule module;\n\n  public PersistAopModule(AbstractPersistenceModule module) {\n    this.module = module;\n  }\n\n  @Override\n  protected void configure() {\n    Key persisterKey = module.selectorKey(Persister.class);\n    WorkInterceptor workInterceptor = new WorkInterceptor(persisterKey);\n    TransactionInterceptor transactionInterceptor = new TransactionInterceptor(persisterKey);\n    requestInjection(workInterceptor);\n    requestInjection(transactionInterceptor);\n\n    Matcher workMatcher = annotatedWith(Work.class);\n    Matcher txnMatcher = annotatedWith(Transactional.class);\n\n    \/\/ Visible persistence APIs.\n    if (module.selector != null) {\n      workMatcher = workMatcher.and(annotatedWith(module.selector));\n      txnMatcher = txnMatcher.and(annotatedWith(module.selector));\n    }\n\n    bindInterceptor(any(), workMatcher, workInterceptor);\n    bindInterceptor(any(), txnMatcher, transactionInterceptor);\n  }\n}\n","subject":"Fix a bad, silly bug where selectors were not being added to matchers in the Persist AOP module"}
{"old_contents":"\/\/ Copyright (C) 2014 The Android Open Source Project\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.googlesource.gerrit.plugins.reviewers.client;\n\nimport com.google.gwt.core.client.JavaScriptObject;\n\npublic class ChangeReviewersInput extends JavaScriptObject {\n  public static ChangeReviewersInput create() {\n    return (ChangeReviewersInput) createObject();\n  }\n\n  protected ChangeReviewersInput() {\n  }\n\n  final void setAction(Action a) {\n    setActionRaw(a.name());\n  }\n\n  private final native void setActionRaw(String a)\n  \/*-{ if(a)this.action=a; }-*\/;\n\n  final native void setFilter(String f)\n  \/*-{ if(f)this.filter=f; }-*\/;\n\n  final native void setReviewer(String r)\n  \/*-{ if(r)this.reviewer=r; }-*\/;\n}\n","new_contents":"\/\/ Copyright (C) 2014 The Android Open Source Project\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.googlesource.gerrit.plugins.reviewers.client;\n\nimport com.google.gwt.core.client.JavaScriptObject;\n\npublic class ChangeReviewersInput extends JavaScriptObject {\n  public static ChangeReviewersInput create() {\n    return (ChangeReviewersInput) createObject();\n  }\n\n  protected ChangeReviewersInput() {\n  }\n\n  final void setAction(Action a) {\n    setActionRaw(a.name());\n  }\n\n  final native void setActionRaw(String a)\n  \/*-{ if(a)this.action=a; }-*\/;\n\n  final native void setFilter(String f)\n  \/*-{ if(f)this.filter=f; }-*\/;\n\n  final native void setReviewer(String r)\n  \/*-{ if(r)this.reviewer=r; }-*\/;\n}\n","subject":"Remove redundant modifier on native method"}
{"old_contents":"\/*\n * Copyright (c) 2013 Ramon Servadei \n *  \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *    \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.fimtra.tcpchannel;\n\nimport com.fimtra.tcpchannel.TcpServer;\nimport com.fimtra.tcpchannel.TcpChannel.FrameEncodingFormatEnum;\n\n\/**\n * Tests the {@link TcpServer} using {@link FrameEncodingFormatEnum#LENGTH_BASED}\n * \n * @author Ramon Servadei\n *\/\npublic class TestTcpServerWithLengthBasedFrameEncodingFormat extends TestTcpServer\n{\n\n    public TestTcpServerWithLengthBasedFrameEncodingFormat()\n    {\n        super();\n        this.frameEncodingFormat = FrameEncodingFormatEnum.LENGTH_BASED;\n    }\n\n}\n","new_contents":"\/*\n * Copyright (c) 2013 Ramon Servadei \n *  \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *    \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.fimtra.tcpchannel;\n\nimport com.fimtra.tcpchannel.TcpServer;\nimport com.fimtra.tcpchannel.TcpChannel.FrameEncodingFormatEnum;\n\n\/**\n * Tests the {@link TcpServer} using {@link FrameEncodingFormatEnum#LENGTH_BASED}\n * \n * @author Ramon Servadei\n *\/\npublic class TestTcpServerWithLengthBasedFrameEncodingFormat extends TestTcpServer\n{\n    static\n    {\n        PORT = 14000;\n    }\n\n    public TestTcpServerWithLengthBasedFrameEncodingFormat()\n    {\n        super();\n        this.frameEncodingFormat = FrameEncodingFormatEnum.LENGTH_BASED;\n    }\n\n}\n","subject":"Use dedicated port range for length-based TcpServer tests"}
{"old_contents":"package com.groupon.seleniumgridextras.config;\n\nimport com.google.gson.Gson;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class HashMapMerger {\n\n  public static Config merge(Config defaultConfig, Config overwriteConfig){\n\n    Map defaultConfigHash   = new HashMap();\n    defaultConfigHash.putAll(convertToHash(convertToString(defaultConfig)));\n\n    Map overwriteConfigHash = convertToHash(convertToString(overwriteConfig));\n    Map finalConfig = overwriteMergeStrategy(defaultConfigHash, overwriteConfigHash);\n\n    String finalConfigString = new Gson().toJson(finalConfig);\n\n    return new Gson().fromJson(finalConfigString, Config.class);\n  }\n\n  private static Map convertToHash(String json){\n    return new Gson().fromJson(json, HashMap.class);\n  }\n\n  private static String convertToString(Config config){\n    return config.toPrettyJsonString();\n  }\n\n  protected static Map overwriteMergeStrategy(Map left, Map right){\n    \/\/As desribed in http:\/\/grepcode.com\/file\/repo1.maven.org\/maven2\/org.codehaus.cargo\/cargo-core-api-module\/0.9\/org\/codehaus\/cargo\/module\/merge\/strategy\/MergeStrategy.java\n    return mergeCurrentLevel(left, right);\n  }\n\n  private static Map mergeCurrentLevel(Map left, Map right){\n\n    for (String key : right.keySet()){\n\n      if (right.get(key) instanceof Map){\n        mergeCurrentLevel((Map)left.get(key), (Map)right.get(key));\n      } else {\n        left.put(key, right.get(key));\n      }\n    }\n    return left;\n  }\n\n}\n","new_contents":"package com.groupon.seleniumgridextras.config;\n\nimport java.util.Map;\n\npublic class HashMapMerger {\n\n  protected static Map overwriteMergeStrategy(Map left, Map right){\n    \/\/As desribed in http:\/\/grepcode.com\/file\/repo1.maven.org\/maven2\/org.codehaus.cargo\/cargo-core-api-module\/0.9\/org\/codehaus\/cargo\/module\/merge\/strategy\/MergeStrategy.java\n    return mergeCurrentLevel(left, right);\n  }\n\n  private static Map mergeCurrentLevel(Map left, Map right){\n\n    for (String key : right.keySet()){\n\n      if (right.get(key) instanceof Map){\n        mergeCurrentLevel((Map)left.get(key), (Map)right.get(key));\n      } else {\n        left.put(key, right.get(key));\n      }\n    }\n    return left;\n  }\n\n}\n","subject":"Delete files that will not be used, simplify the class to bare bones"}
{"old_contents":"package utilities;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.ByteBuffer;\nimport java.nio.channels.Channels;\nimport java.nio.channels.ReadableByteChannel;\nimport java.nio.channels.WritableByteChannel;\n\npublic class IoUtil {\n\n\tprivate static final int INPUT_STREAM_BUFFER_SIZE = 64;\n\n\tprivate IoUtil() {}\n\n\t\/**\n\t * Read all content from an input stream to a byte array.\n\t * This does not close the input channel after reading. The caller\n\t * is responsible for doing that.\n\t *\/\n\tpublic static byte[] streamToBytes(InputStream in) throws IOException {\n\t    ReadableByteChannel channel = Channels.newChannel(in);\n\t    ByteBuffer byteBuffer = ByteBuffer.allocate(INPUT_STREAM_BUFFER_SIZE);\n\t    ByteArrayOutputStream bout = new ByteArrayOutputStream();\n\t    WritableByteChannel outChannel = Channels.newChannel(bout);\n\t    while (channel.read(byteBuffer) > 0 || byteBuffer.position() > 0) {\n\t        byteBuffer.flip();  \/\/ Make buffer ready for write.\n\t        outChannel.write(byteBuffer);\n\t        byteBuffer.compact(); \/\/ Make buffer ready for reading.\n\t    }\n\t    outChannel.close();\n\t    return bout.toByteArray();\n\t}\n}\n","new_contents":"package utilities;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.Buffer;\nimport java.nio.ByteBuffer;\nimport java.nio.channels.Channels;\nimport java.nio.channels.ReadableByteChannel;\nimport java.nio.channels.WritableByteChannel;\n\npublic class IoUtil {\n\n\tprivate static final int INPUT_STREAM_BUFFER_SIZE = 64;\n\n\tprivate IoUtil() {}\n\n\t\/**\n\t * Read all content from an input stream to a byte array.\n\t * This does not close the input channel after reading. The caller\n\t * is responsible for doing that.\n\t *\/\n\tpublic static byte[] streamToBytes(InputStream in) throws IOException {\n\t    ReadableByteChannel channel = Channels.newChannel(in);\n\t    ByteBuffer byteBuffer = ByteBuffer.allocate(INPUT_STREAM_BUFFER_SIZE);\n\t    ByteArrayOutputStream bout = new ByteArrayOutputStream();\n\t    WritableByteChannel outChannel = Channels.newChannel(bout);\n\t    while (channel.read(byteBuffer) > 0 || byteBuffer.position() > 0) {\n            \/\/ Casting is necessary here.\n            \/\/ Similar fix in https:\/\/jira.mongodb.org\/browse\/JAVA-2559\n            \/\/ https:\/\/community.blynk.cc\/t\/java-error-on-remote-server-startup\/17957\/7\n\t    \t((Buffer) byteBuffer).flip();  \/\/ Make buffer ready for write.\n\t        outChannel.write(byteBuffer);\n\t        byteBuffer.compact(); \/\/ Make buffer ready for reading.\n\t    }\n\t    outChannel.close();\n\t    return bout.toByteArray();\n\t}\n}\n","subject":"Fix a backward compatibility bug between Java 10 and Java 8."}
{"old_contents":"package clientAPI;\r\n\r\nimport clientAPI.impl.BonusCreditStoreConnector;\r\nimport clientAPI.impl.CryptoStoreConnector;\r\nimport clientAPI.impl.PersonalDataConnector;\r\nimport clientAPI.impl.TicketManagerConnector;\r\nimport clientAPI.impl.WalletConnector;\r\nimport javax.smartcardio.Card;\r\n\r\n\r\npublic class ClientFactory {\r\n\r\n\t\r\n\t\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static TicketManager getTicketManager(Card card) {\r\n\t\treturn new TicketManagerConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static Wallet getWallet(Card card) {\r\n\t\treturn new WalletConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static BonusCreditStore getBonusCreditStore(Card card) {\r\n\t\treturn new BonusCreditStoreConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static PersonalData getCustomerData(Card card) {\r\n\t\treturn new PersonalDataConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static CryptoStore getCryptoStore(Card card) {\r\n\t\treturn new CryptoStoreConnector(card);\r\n\t}\r\n}\r\n","new_contents":"package clientAPI;\r\n\r\nimport clientAPI.impl.BonusCreditStoreConnector;\r\nimport clientAPI.impl.CryptoStoreConnector;\r\nimport clientAPI.impl.PersonalDataConnector;\r\nimport clientAPI.impl.TicketManagerConnector;\r\nimport clientAPI.impl.WalletConnector;\r\nimport javax.smartcardio.Card;\r\n\r\n\r\npublic class ClientFactory {\r\n\r\n\t\r\n\t\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static TicketManager getTicketManager(Card card) {\r\n\t\treturn new TicketManagerConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static Wallet getWallet(Card card) {\r\n\t\treturn new WalletConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static BonusCreditStore getBonusCreditStore(Card card) {\r\n\t\treturn new BonusCreditStoreConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static PersonalData getPersonalData(Card card) {\r\n\t\treturn new PersonalDataConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static CryptoStore getCryptoStore(Card card) {\r\n\t\treturn new CryptoStoreConnector(card);\r\n\t}\r\n}\r\n","subject":"Rename method for getting PersonalData instance"}
{"old_contents":"package com.gh4a.loader;\n\nimport java.util.HashMap;\n\nimport android.content.Context;\nimport android.support.v4.content.AsyncTaskLoader;\nimport android.util.Log;\n\nimport com.bugsense.trace.BugSenseHandler;\nimport com.gh4a.Constants;\nimport com.gh4a.Constants.LoaderResult;\n\npublic abstract class BaseLoader extends AsyncTaskLoader> {\n\n    public BaseLoader(Context context) {\n        super(context);\n    }\n\n    @Override\n    public HashMap loadInBackground() {\n        HashMap result = new HashMap();\n        try {\n            doLoadInBackground(result);\n            return result;\n        } catch (Exception e) {\n            result.put(LoaderResult.ERROR, true);\n            result.put(LoaderResult.ERROR_MSG, e.getMessage());\n            if (\"Received authentication challenge is null\".equalsIgnoreCase(e.getMessage())) {\n                result.put(LoaderResult.AUTH_ERROR, true);\n            }\n            Log.e(Constants.LOG_TAG, e.getMessage(), e);\n            return result;\n        }\n    }\n    \n    public abstract void doLoadInBackground(HashMap result) throws Exception;\n\n}\n","new_contents":"package com.gh4a.loader;\n\nimport java.util.HashMap;\n\nimport android.content.Context;\nimport android.support.v4.content.AsyncTaskLoader;\nimport android.util.Log;\n\nimport com.gh4a.Constants;\nimport com.gh4a.Constants.LoaderResult;\n\npublic abstract class BaseLoader extends AsyncTaskLoader> {\n\n    public BaseLoader(Context context) {\n        super(context);\n    }\n\n    @Override\n    public HashMap loadInBackground() {\n        HashMap result = new HashMap();\n        try {\n            doLoadInBackground(result);\n            return result;\n        } catch (Exception e) {\n            result.put(LoaderResult.ERROR, true);\n            result.put(LoaderResult.ERROR_MSG, e.getMessage());\n            if (\"Received authentication challenge is null\".equalsIgnoreCase(e.getMessage())\n                    || \"No authentication challenges found\".equalsIgnoreCase(e.getMessage())) {\n                result.put(LoaderResult.AUTH_ERROR, true);\n            }\n            Log.e(Constants.LOG_TAG, e.getMessage(), e);\n            return result;\n        }\n    }\n    \n    public abstract void doLoadInBackground(HashMap result) throws Exception;\n\n}\n","subject":"Handle auth error on JB"}
{"old_contents":"package io.pivotal.portfolio.config;\n\nimport org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerExchangeFilterFunction;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;\nimport org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository;\nimport org.springframework.security.oauth2.client.web.reactive.function.client.ServletOAuth2AuthorizedClientExchangeFilterFunction;\nimport org.springframework.web.reactive.function.client.WebClient;\n\n@Configuration\npublic class BeanConfiguration {\n\n\n    @Bean\n    public WebClient webClient(LoadBalancerExchangeFilterFunction eff) {\n        return WebClient.builder()\n                .filter(eff)\n                .build();\n    }\n\n}\n","new_contents":"package io.pivotal.portfolio.config;\n\nimport org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerExchangeFilterFunction;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;\nimport org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository;\nimport org.springframework.security.oauth2.client.web.reactive.function.client.ServletOAuth2AuthorizedClientExchangeFilterFunction;\nimport org.springframework.web.reactive.function.client.WebClient;\n\n@Configuration\npublic class BeanConfiguration {\n\n\n    @Bean\n    public WebClient webClient(WebClient.Builder webClientBuilder, LoadBalancerExchangeFilterFunction eff) {\n        return  webClientBuilder\n                .filter(eff)\n                .build();\n    }\n\n}\n","subject":"Fix definition of web client builder"}
{"old_contents":"package com.uwetrottmann.thetvdb;\n\nimport org.junit.BeforeClass;\n\npublic abstract class BaseTestCase {\n\n    \/\/ Do NOT use this token in your application, for testing purposes only!\n    private static final String JSON_WEB_TOKEN = \"\";\n\n    private static final boolean DEBUG = true;\n\n    private static final TheTvdb theTvdb = new TheTvdb();\n\n    @BeforeClass\n    public static void setUpOnce() {\n        theTvdb.setJsonWebToken(JSON_WEB_TOKEN);\n        theTvdb.setIsDebug(DEBUG);\n    }\n\n    protected final TheTvdb getTheTvdb() {\n        return theTvdb;\n    }\n\n}\n","new_contents":"package com.uwetrottmann.thetvdb;\n\nimport org.junit.BeforeClass;\n\npublic abstract class BaseTestCase {\n\n    \/\/ Do NOT use this token in your application, for testing purposes only!\n    private static final String JSON_WEB_TOKEN = \"\";\n\n    private static final boolean DEBUG = true;\n\n    private static final TheTvdb theTvdb = new TheTvdb();\n\n    @BeforeClass\n    public static void setUpOnce() {\n        if (JSON_WEB_TOKEN.length() == 0) {\n            System.err.println(\"No valid JSON Web Token is set. API methods other than \/login will fail.\");\n        }\n        theTvdb.setJsonWebToken(JSON_WEB_TOKEN);\n        theTvdb.setIsDebug(DEBUG);\n    }\n\n    protected final TheTvdb getTheTvdb() {\n        return theTvdb;\n    }\n\n}\n","subject":"Add warning if no JSON web token is set."}
{"old_contents":"package com.adaptionsoft.games.uglytrivia;\n\nimport org.junit.Before;\nimport org.junit.Ignore;\nimport org.junit.Test;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.core.Is.is;\nimport static org.mockito.Mockito.mock;\n\npublic class PlayersTest {\n\n    public static final String PLAYER_ONE = \"Thomas\";\n    public static final String PLAYER_TWO = \"Peter\";\n    public static final String ANY_PLAYER = \"Erik\";\n\n    \/\/ TODO minor duplication in all Player tests for creating the Players instance.\n    private PlayerUi ui = mock(PlayerUi.class);\n    private Players players = new Players(ui);\n\n    @Before\n    public void addPlayers() {\n        players.add(PLAYER_ONE);\n        players.add(PLAYER_TWO);\n    }\n\n    @Test\n    public void shouldAddOnePlayer() {\n        assertThat(players.size(), is(2));\n\n        players.add(TestPlayer.named(ANY_PLAYER));\n\n        assertThat(players.size(), is(3));\n    }\n\n    @Test(expected = IllegalAccessException.class)\n    @Ignore(\"not implemented\")\n    public void shouldFailForMoreThanSixPlayers() {\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(\"one too many\");\n    }\n}\n","new_contents":"package com.adaptionsoft.games.uglytrivia;\n\nimport org.junit.Before;\nimport org.junit.Ignore;\nimport org.junit.Test;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.core.Is.is;\nimport static org.mockito.Mockito.mock;\n\npublic class PlayersTest {\n\n    private static final String PLAYER_ONE = \"Thomas\";\n    private static final String PLAYER_TWO = \"Peter\";\n    private static final String ANY_PLAYER = \"Erik\";\n\n    \/\/ TODO minor duplication in all Player tests for creating the Players instance.\n    private PlayerUi ui = mock(PlayerUi.class);\n    private Players players = new Players(ui);\n\n    @Before\n    public void addPlayers() {\n        players.add(PLAYER_ONE);\n        players.add(PLAYER_TWO);\n    }\n\n    @Test\n    public void shouldAddOnePlayer() {\n        assertThat(players.size(), is(2));\n\n        players.add(TestPlayer.named(ANY_PLAYER));\n\n        assertThat(players.size(), is(3));\n    }\n\n    @Test(expected = IllegalAccessException.class)\n    @Ignore(\"not implemented\")\n    public void shouldFailForMoreThanSixPlayers() {\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(\"one too many\");\n    }\n}\n","subject":"Reduce visibility (as proposed by inspection)."}
{"old_contents":"package nl.tudelft.ewi.dea.jaxrs.api;\n\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\n\nimport com.google.inject.servlet.RequestScoped;\n\n@RequestScoped\n@Path(\"api\/exception\")\npublic class ExceptionAASResource {\n\n\t@GET\n\tpublic void throwException() {\n\t\tthrow new RuntimeException(\"Your Exception-As-A-Service is served!\");\n\t}\n\n}\n","new_contents":"package nl.tudelft.ewi.dea.jaxrs.api;\n\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.core.Response;\n\nimport com.google.inject.servlet.RequestScoped;\n\n@RequestScoped\n@Path(\"api\/exception\")\npublic class ExceptionAASResource {\n\n\t@GET\n\tpublic Response throwException() {\n\t\tthrow new RuntimeException(\"Your Exception-As-A-Service is served!\");\n\t}\n\n}\n","subject":"Return Response instead of void as per the spec."}
{"old_contents":"\/*\n * This file is part of SpongeAPI, licensed under the MIT License (MIT).\n *\n * Copyright (c) SpongePowered \n * Copyright (c) contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\/\npackage org.spongepowered.api.event;\n\n\/**\n * Represents a handler accepting events of a specified type.\n *\n * @param  The type of the event\n *\/\npublic interface EventHandler {\n\n    \/**\n     * Called when a event registered to this handler is called.\n     *\n     * @param event The called event\n     *\/\n    void handle(T event);\n\n}\n","new_contents":"\/*\n * This file is part of SpongeAPI, licensed under the MIT License (MIT).\n *\n * Copyright (c) SpongePowered \n * Copyright (c) contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\/\npackage org.spongepowered.api.event;\n\n\/**\n * Represents a handler accepting events of a specified type.\n *\n * @param  The type of the event\n *\/\npublic interface EventHandler {\n\n    \/**\n     * Called when a event registered to this handler is called.\n     *\n     * @param event The called event\n     * @throws Exception If an error occurs\n     *\/\n    void handle(T event) throws Exception;\n\n}\n","subject":"Allow dynamic event handlers to throw checked exceptions"}
{"old_contents":"package roycurtis.signshopexport.json;\n\nimport com.google.gson.ExclusionStrategy;\nimport com.google.gson.FieldAttributes;\n\n\/** Exclusions class for blacklisting objects and fields in Gson *\/\npublic class Exclusions implements ExclusionStrategy\n{\n    @Override\n    public boolean shouldSkipField(FieldAttributes f)\n    {\n        String name = f.getName();\n\n        return\n            \/\/ Ignore dynamic CraftBukkit handle field\n            name.equalsIgnoreCase(\"handle\")\n            \/\/ Ignore book page contents\n            || name.equalsIgnoreCase(\"pages\")\n            \/\/ Ignore unsupported tags\n            || name.equalsIgnoreCase(\"unhandledTags\")\n            \/\/ Ignore redundant data object\n            || name.equalsIgnoreCase(\"data\")\n            \/\/ Ignore hide flags\n            || name.equalsIgnoreCase(\"hideFlag\")\n            \/\/ Ignore repair costs\n            || name.equalsIgnoreCase(\"repairCost\")\n            \/\/ Ignore skull profiles\n            || name.equalsIgnoreCase(\"profile\")\n            \/\/ Ignore shield patterns\n            || name.equalsIgnoreCase(\"blockEntityTag\");\n    }\n\n    @Override\n    public boolean shouldSkipClass(Class clazz)\n    {\n        String name = clazz.getSimpleName();\n\n        if ( name.equalsIgnoreCase(\"ItemStack\") )\n        if ( clazz.getTypeName().startsWith(\"net.minecraft.server\") )\n            return true;\n\n        return name.equalsIgnoreCase(\"ChatComponentText\");\n    }\n}","new_contents":"package roycurtis.signshopexport.json;\n\nimport com.google.gson.ExclusionStrategy;\nimport com.google.gson.FieldAttributes;\n\n\/** Exclusions class for blacklisting objects and fields in Gson *\/\npublic class Exclusions implements ExclusionStrategy\n{\n    @Override\n    public boolean shouldSkipField(FieldAttributes f)\n    {\n        String name = f.getName();\n\n        return\n            \/\/ Ignore dynamic CraftBukkit handle field\n            name.equalsIgnoreCase(\"handle\")\n            \/\/ Ignore book page contents\n            || name.equalsIgnoreCase(\"pages\")\n            \/\/ Ignore unsupported tags\n            || name.equalsIgnoreCase(\"unhandledTags\")\n            \/\/ Ignore redundant data object\n            || name.equalsIgnoreCase(\"data\")\n            \/\/ Ignore hide flags\n            || name.equalsIgnoreCase(\"hideFlag\")\n            \/\/ Ignore repair costs\n            || name.equalsIgnoreCase(\"repairCost\")\n            \/\/ Ignore skull profiles\n            || name.equalsIgnoreCase(\"profile\")\n            \/\/ Ignore shield patterns\n            || name.equalsIgnoreCase(\"blockEntityTag\")\n            \/\/ Ignore 1.11 unbreakable tag\n            || name.equalsIgnoreCase(\"unbreakable\");\n    }\n\n    @Override\n    public boolean shouldSkipClass(Class clazz)\n    {\n        String name = clazz.getSimpleName();\n\n        if ( name.equalsIgnoreCase(\"ItemStack\") )\n        if ( clazz.getTypeName().startsWith(\"net.minecraft.server\") )\n            return true;\n\n        return name.equalsIgnoreCase(\"ChatComponentText\");\n    }\n}","subject":"Exclude 1.11's \"unbreakable\" common tag"}
{"old_contents":"package openperipheral.addons.glasses;\n\nimport net.minecraft.client.renderer.texture.IIconRegister;\nimport net.minecraft.entity.player.EntityPlayer;\nimport net.minecraft.item.Item;\nimport net.minecraft.item.ItemStack;\nimport net.minecraft.world.World;\nimport openperipheral.addons.OpenPeripheralAddons;\nimport openperipheral.addons.api.ITerminalItem;\nimport cpw.mods.fml.common.FMLCommonHandler;\n\npublic class ItemKeyboard extends Item {\n\n\tpublic ItemKeyboard() {\n\t\tsetCreativeTab(OpenPeripheralAddons.tabOpenPeripheralAddons);\n\t\tsetMaxStackSize(1);\n\t}\n\n\t@Override\n\tpublic void registerIcons(IIconRegister register) {\n\t\titemIcon = register.registerIcon(\"openperipheraladdons:keyboard\");\n\t}\n\n\t@Override\n\tpublic ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {\n\t\tif (world.isRemote) {\n\t\t\tItemStack helmet = TerminalUtils.getHeadSlot(player);\n\t\t\tif (helmet != null) {\n\t\t\t\tItem item = helmet.getItem();\n\t\t\t\tif (item instanceof ITerminalItem) {\n\t\t\t\t\tlong guid = ((ITerminalItem)item).getTerminalGuid(helmet);\n\t\t\t\t\tFMLCommonHandler.instance().showGuiScreen(new GuiCapture(guid));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn stack;\n\t}\n\n}\n","new_contents":"package openperipheral.addons.glasses;\n\nimport net.minecraft.client.renderer.texture.IIconRegister;\nimport net.minecraft.entity.player.EntityPlayer;\nimport net.minecraft.item.Item;\nimport net.minecraft.item.ItemStack;\nimport net.minecraft.world.World;\nimport openperipheral.addons.OpenPeripheralAddons;\nimport openperipheral.addons.api.ITerminalItem;\nimport cpw.mods.fml.common.FMLCommonHandler;\n\npublic class ItemKeyboard extends Item {\n\n\tpublic ItemKeyboard() {\n\t\tsetCreativeTab(OpenPeripheralAddons.tabOpenPeripheralAddons);\n\t\tsetMaxStackSize(1);\n\t}\n\n\t@Override\n\tpublic void registerIcons(IIconRegister register) {\n\t\titemIcon = register.registerIcon(\"openperipheraladdons:keyboard\");\n\t}\n\n\t@Override\n\tpublic ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {\n\t\tif (world.isRemote) {\n\t\t\tItemStack helmet = TerminalUtils.getHeadSlot(player);\n\t\t\tif (helmet != null) {\n\t\t\t\tItem item = helmet.getItem();\n\t\t\t\tif (item instanceof ITerminalItem) {\n\t\t\t\t\tLong guid = ((ITerminalItem)item).getTerminalGuid(helmet);\n\t\t\t\t\tif (guid != null) FMLCommonHandler.instance().showGuiScreen(new GuiCapture(guid));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn stack;\n\t}\n\n}\n","subject":"Fix NPE when using keyboard"}
{"old_contents":"package com.reactlibrary.linkedinsdk;\n\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\n\npublic class RNLinkedInSessionManagerPackage implements ReactPackage {\n    @Override\n    public List createNativeModules(ReactApplicationContext reactContext) {\n      return Arrays.asList(new RNLinkedInSessionManagerModule(reactContext));\n    }\n\n    @Override\n    public List> createJSModules() {\n      return Collections.emptyList();\n    }\n\n    @Override\n    public List createViewManagers(ReactApplicationContext reactContext) {\n      return Collections.emptyList();\n    }\n}\n","new_contents":"package com.reactlibrary.linkedinsdk;\n\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\n\npublic class RNLinkedInSessionManagerPackage implements ReactPackage {\n    @Override\n    public List createNativeModules(ReactApplicationContext reactContext) {\n      return Arrays.asList(new RNLinkedInSessionManagerModule(reactContext));\n    }\n\n    \/\/ Deprecated RN 0.47\n    public List> createJSModules() {\n      return Collections.emptyList();\n    }\n\n    @Override\n    public List createViewManagers(ReactApplicationContext reactContext) {\n      return Collections.emptyList();\n    }\n}\n","subject":"Handle Android RN 0.47 breaking change"}
{"old_contents":"package de.linkvt.bachelor.features.annotations;\n\nimport de.linkvt.bachelor.features.Feature;\nimport de.linkvt.bachelor.features.FeatureCategory;\n\nimport org.semanticweb.owlapi.model.OWLAnnotation;\nimport org.semanticweb.owlapi.model.OWLAxiom;\nimport org.semanticweb.owlapi.model.OWLObjectProperty;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class OwlDeprecatedPropertyFeature extends Feature {\n  @Override\n  public void addToOntology() {\n    OWLObjectProperty property = featurePool.getExclusiveProperty(\"::DeprecatedProperty\");\n    addToGenericDomainAndNewRange(property, featurePool.getExclusiveClass(\":DeprecatedPropertyRange\"));\n\n    OWLAnnotation annotation = factory.getOWLAnnotation(factory.getOWLDeprecated(), factory.getOWLLiteral(true));\n    OWLAxiom deprecatedAxiom = factory.getOWLAnnotationAssertionAxiom(property.getIRI(), annotation);\n    addAxiomToOntology(deprecatedAxiom);\n  }\n\n  @Override\n  public String getName() {\n    return \"owl:DeprecatedProperty\";\n  }\n\n  @Override\n  public String getToken() {\n    return \"deprecatedprop\";\n  }\n\n  @Override\n  public FeatureCategory getCategory() {\n    return FeatureCategory.ANNOTATIONS;\n  }\n}\n","new_contents":"package de.linkvt.bachelor.features.annotations;\n\nimport de.linkvt.bachelor.features.Feature;\nimport de.linkvt.bachelor.features.FeatureCategory;\n\nimport org.semanticweb.owlapi.model.OWLAnnotation;\nimport org.semanticweb.owlapi.model.OWLAxiom;\nimport org.semanticweb.owlapi.model.OWLObjectProperty;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class OwlDeprecatedPropertyFeature extends Feature {\n  @Override\n  public void addToOntology() {\n    OWLObjectProperty property = featurePool.getExclusiveProperty(\":DeprecatedProperty\");\n    addToGenericDomainAndNewRange(property, featurePool.getExclusiveClass(\":DeprecatedPropertyRange\"));\n\n    OWLAnnotation annotation = factory.getOWLAnnotation(factory.getOWLDeprecated(), factory.getOWLLiteral(true));\n    OWLAxiom deprecatedAxiom = factory.getOWLAnnotationAssertionAxiom(property.getIRI(), annotation);\n    addAxiomToOntology(deprecatedAxiom);\n  }\n\n  @Override\n  public String getName() {\n    return \"owl:DeprecatedProperty\";\n  }\n\n  @Override\n  public String getToken() {\n    return \"deprecatedprop\";\n  }\n\n  @Override\n  public FeatureCategory getCategory() {\n    return FeatureCategory.ANNOTATIONS;\n  }\n}\n","subject":"Fix prefix of deprecated property"}
{"old_contents":"package edu.northwestern.bioinformatics.studycalendar.dao;\n\nimport edu.northwestern.bioinformatics.studycalendar.domain.PlannedActivity;\nimport org.springframework.transaction.annotation.Transactional;\n\nimport java.util.List;\n\n\/**\n * @author Rhett Sutphin\n *\/\n@Transactional (readOnly=true)\npublic class PlannedActivityDao extends StudyCalendarMutableDomainObjectDao {\n    @Override\n    public Class domainClass() {\n        return PlannedActivity.class;\n    }\n\n    @Transactional(readOnly=false)\n    public void delete(PlannedActivity event) {\n        getHibernateTemplate().delete(event);\n    }\n\n    public List getPlannedActivitiesForAcivity(Integer activityId) {\n\n        return (List) getHibernateTemplate().find(\"select pa from PlannedActivity as pa where pa.activity.id=?\",activityId);\n    }\n\n   \n}\n","new_contents":"package edu.northwestern.bioinformatics.studycalendar.dao;\n\nimport edu.northwestern.bioinformatics.studycalendar.domain.PlannedActivity;\nimport org.springframework.transaction.annotation.Transactional;\n\nimport java.util.List;\n\n\/**\n * @author Rhett Sutphin\n *\/\n@Transactional (readOnly=true)\npublic class PlannedActivityDao extends StudyCalendarMutableDomainObjectDao {\n    @Override\n    public Class domainClass() {\n        return PlannedActivity.class;\n    }\n\n    \/**\n    * Deletes a planned activity\n    *\n    * @param  event the planned activity to delete\n    *\/\n    @Transactional(readOnly=false)\n    public void delete(PlannedActivity event) {\n        getHibernateTemplate().delete(event);\n    }\n\n    \/**\n    * Finds all planned activities for a activity id\n    *\n    * @param  activityId the activity id to search with\n    * @return      a list of planned activities with the activity id passed in\n    *\/\n    public List getPlannedActivitiesForAcivity(Integer activityId) {\n        return (List) getHibernateTemplate().find(\"select pa from PlannedActivity as pa where pa.activity.id=?\",activityId);\n    }\n}\n","subject":"Add javadoc to planned activity dao."}
{"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\npackage org.apache.commons.compress.archivers;\n\n\/**\n * Exception thrown by ArchiveStreamFactory if a format is\n * requested\/detected that doesn't support streaming.\n * @since 1.8\n *\/\npublic class StreamingNotSupportedException extends ArchiveException {\n    private final String format;\n\n    \/**\n     * Creates a new StreamingNotSupportedException.\n     * @param format the format that has been requested\/detected.\n     *\/\n    public StreamingNotSupportedException(String format) {\n        super(\"The \" + format + \" doesn't support streaming.\");\n        this.format = format;\n    }\n\n    \/**\n     * Returns the format that has been requested\/detected.\n     * @return the format that has been requested\/detected.\n     *\/\n    public String getFormat() {\n        return format;\n    }\n    \n}\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\npackage org.apache.commons.compress.archivers;\n\n\/**\n * Exception thrown by ArchiveStreamFactory if a format is\n * requested\/detected that doesn't support streaming.\n * @since 1.8\n *\/\npublic class StreamingNotSupportedException extends ArchiveException {\n    \n    private static final long serialVersionUID = 1L;\n    \n    private final String format;\n\n    \/**\n     * Creates a new StreamingNotSupportedException.\n     * @param format the format that has been requested\/detected.\n     *\/\n    public StreamingNotSupportedException(String format) {\n        super(\"The \" + format + \" doesn't support streaming.\");\n        this.format = format;\n    }\n\n    \/**\n     * Returns the format that has been requested\/detected.\n     * @return the format that has been requested\/detected.\n     *\/\n    public String getFormat() {\n        return format;\n    }\n    \n}\n","subject":"Add missing serial version ID (default)."}
{"old_contents":"package com.snowble.android.widget.verticalstepper;\n\nimport android.content.res.Resources;\nimport android.util.TypedValue;\n\nclass ThemeUtils {\n    public static int getResolvedAttributeData(Resources.Theme theme, int attr, int defaultData) {\n        TypedValue value = new TypedValue();\n        theme.resolveAttribute(attr, value, false);\n        int resolvedAttributeData;\n        if (value.type != TypedValue.TYPE_NULL) {\n            resolvedAttributeData = value.data;\n        } else {\n            resolvedAttributeData = defaultData;\n        }\n        return resolvedAttributeData;\n    }\n}\n","new_contents":"package com.snowble.android.widget.verticalstepper;\n\nimport android.content.res.Resources;\nimport android.util.TypedValue;\n\nclass ThemeUtils {\n    static int getResolvedAttributeData(Resources.Theme theme, int attr, int defaultData) {\n        TypedValue value = new TypedValue();\n        theme.resolveAttribute(attr, value, false);\n        int resolvedAttributeData;\n        if (value.type != TypedValue.TYPE_NULL) {\n            resolvedAttributeData = value.data;\n        } else {\n            resolvedAttributeData = defaultData;\n        }\n        return resolvedAttributeData;\n    }\n}\n","subject":"Reduce visibility one more time"}
{"old_contents":"package referencelibrary;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport referencelibrary.data.StubDao;\nimport referencelibrary.reference.BookReference;\nimport referencelibrary.reference.Reference;\n\nimport java.util.List;\n\nimport static org.junit.Assert.*;\nimport referencelibrary.util.FileUtil;\n\n\/**\n * Created by petri on 18.4.2016.\n *\/\npublic class AppTest {\n    private App app;\n\n    @Before\n    public void setUp() {\n        app = new App(new StubDao());\n    }\n\n    @Test\n    public void newReference() {\n        app.newReference(new BookReference(\"REF1\"));\n        List reflist = app.listReferences();\n        assertEquals(2, reflist.size());\n        assertEquals(\"REF1\", reflist.get(1).getReferenceName());\n    }\n\n    @Test\n    public void listReferences() {\n        List reflist = app.listReferences();\n        assertEquals(\"REF\", reflist.get(0).getReferenceName());\n    }\n\n    @Test\n    public void generateBixTexFile() {\n        String filename = \"test_bibtex.bib\";\n        app.generateBixTexFile(filename);\n        String result = FileUtil.Read(filename);\n        assertEquals(\"@Book{REF,\\n}\\n\\n\", result);\n    }\n\n}","new_contents":"package referencelibrary;\n\nimport java.io.File;\nimport org.junit.Before;\nimport org.junit.Test;\nimport referencelibrary.data.StubDao;\nimport referencelibrary.reference.BookReference;\nimport referencelibrary.reference.Reference;\n\nimport java.util.List;\nimport org.junit.After;\n\nimport static org.junit.Assert.*;\nimport referencelibrary.util.FileUtil;\n\n\/**\n * Created by petri on 18.4.2016.\n *\/\npublic class AppTest {\n    private final String filename = \"test_bibtex.bib\";\n    private App app;\n\n    @Before\n    public void setUp() {\n        app = new App(new StubDao());\n        File testFile = new File(filename);\n        testFile.delete();\n    }\n\n    @After\n    public void tearDown() {\n        File testFile = new File(filename);\n        testFile.delete();\n    }\n\n    @Test\n    public void newReference() {\n        app.newReference(new BookReference(\"REF1\"));\n        List reflist = app.listReferences();\n        assertEquals(2, reflist.size());\n        assertEquals(\"REF1\", reflist.get(1).getReferenceName());\n    }\n\n    @Test\n    public void listReferences() {\n        List reflist = app.listReferences();\n        assertEquals(\"REF\", reflist.get(0).getReferenceName());\n    }\n\n    @Test\n    public void generateBixTexFile() {\n        app.generateBixTexFile(filename);\n        String result = FileUtil.Read(filename);\n        assertEquals(\"@Book{REF,\\n}\\n\\n\", result);\n    }\n\n}","subject":"Make BookReference test cleanup test file"}
{"old_contents":"package com.uwetrottmann.trakt.v2.entities;\n\npublic class Images {\n\n    public MoreImageSizes poster;\n    public MoreImageSizes fanart;\n    \/** A {@link com.uwetrottmann.trakt.v2.entities.Person} has headshots. *\/\n    public MoreImageSizes headshot;\n    public ImageSizes banner;\n    public ImageSizes logo;\n    public ImageSizes clearart;\n    public ImageSizes thumb;\n    public ImageSizes screenshot;\n    public ImageSizes avatar;\n\n}\n","new_contents":"package com.uwetrottmann.trakt.v2.entities;\n\npublic class Images {\n\n    public MoreImageSizes poster;\n    public MoreImageSizes fanart;\n    public MoreImageSizes screenshot;\n    \/** A {@link com.uwetrottmann.trakt.v2.entities.Person} has headshots. *\/\n    public MoreImageSizes headshot;\n    public ImageSizes banner;\n    public ImageSizes logo;\n    public ImageSizes clearart;\n    public ImageSizes thumb;\n    public ImageSizes avatar;\n\n}\n","subject":"Add additional image sizes for screenshots."}
{"old_contents":"package com.uwetrottmann.trakt.v2.entities;\n\nimport com.uwetrottmann.trakt.v2.enums.Rating;\n\npublic class Season {\n\n    public Integer number;\n    public SeasonIds ids;\n\n    public Rating rating;\n    public Integer episode_count;\n    public Images images;\n\n}\n","new_contents":"package com.uwetrottmann.trakt.v2.entities;\n\npublic class Season {\n\n    public Integer number;\n    public SeasonIds ids;\n\n    public Double rating;\n    public Integer episode_count;\n    public Images images;\n\n}\n","subject":"Make season rating a global rating, so double type."}
{"old_contents":"package nom.bdezonia.zorbage.type.algebra;\n\nimport nom.bdezonia.zorbage.function.Function1;\n\n\/**\n * \n * @author Barry DeZonia\n *\n *\/\npublic interface EvenOdd {\n\tFunction1 isEven();\n\tFunction1 isOdd();\n}\n","new_contents":"\/*\n * Zorbage: an algebraic data hierarchy for use in numeric processing.\n *\n * Copyright (C) 2016-2019 Barry DeZonia\n * \n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * \n * 1. Redistributions of source code must retain the above copyright notice,\n *    this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the documentation\n *    and\/or other materials provided with the distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\/\npackage nom.bdezonia.zorbage.type.algebra;\n\nimport nom.bdezonia.zorbage.function.Function1;\n\n\/**\n * \n * @author Barry DeZonia\n *\n *\/\npublic interface EvenOdd {\n\tFunction1 isEven();\n\tFunction1 isOdd();\n}\n","subject":"Add license header to file that needs it"}
{"old_contents":"package commands;\n\npublic class RegexConstants\n{\n    public static final String CHANNEL = \"[\\\\w-_]+\";\n\n    private RegexConstants(){}\n\n    public static final String SPACES = \"\\\\s+\";\n    public static final String CHANGE_ID = \"\\\\d+\";\n    public static final String PROJECT = \"[^@]\\\\W*\";\n\n    public static final String USER_ALIAS = \"@\\\\S*\";\n    public static final String ANYTHING_ELSE = \".*\";\n    public static final String COMMENT = ANYTHING_ELSE;\n\n}\n","new_contents":"package commands;\n\npublic class RegexConstants\n{\n    public static final String CHANNEL = \"[\\\\w-_]+\";\n\n    private RegexConstants(){}\n\n    public static final String SPACES = \"\\\\s+\";\n    public static final String CHANGE_ID = \"\\\\d+\";\n    public static final String PROJECT = \"[^@][\\\\w|-]+\";\n\n    public static final String USER_ALIAS = \"@\\\\S*\";\n    public static final String ANYTHING_ELSE = \".*\";\n    public static final String COMMENT = ANYTHING_ELSE;\n\n}\n","subject":"Fix parsing of project name"}
{"old_contents":"package com.elmakers.mine.bukkit.api.block;\n\nimport java.util.List;\n\nimport org.bukkit.Location;\nimport org.bukkit.block.Block;\nimport org.bukkit.entity.Entity;\n\nimport com.elmakers.mine.bukkit.api.magic.Mage;\n\npublic interface UndoList extends BlockList, Comparable {\n    public void commit();\n    public void undo();\n    public void undo(boolean undoEntityChanges);\n\n    public void setScheduleUndo(int ttl);\n    public int getScheduledUndo();\n    public boolean bypass();\n    public long getCreatedTime();\n    public long getModifiedTime();\n    public long getScheduledTime();\n    public boolean isScheduled();\n\n    public void prune();\n\n    public void add(Entity entity);\n    public void remove(Entity entity);\n    public void modify(Entity entity);\n    public void add(Runnable runnable);\n\n    public void convert(Entity entity, Block block);\n    public void fall(Entity entity, Block block);\n    public void explode(Entity entity, List explodedBlocks);\n    public void cancelExplosion(Entity entity);\n\n    public boolean contains(Location location, int threshold);\n\n    public String getName();\n    public Mage getOwner();\n}\n","new_contents":"package com.elmakers.mine.bukkit.api.block;\n\nimport java.util.List;\n\nimport com.elmakers.mine.bukkit.api.entity.EntityData;\nimport org.bukkit.Location;\nimport org.bukkit.block.Block;\nimport org.bukkit.entity.Entity;\n\nimport com.elmakers.mine.bukkit.api.magic.Mage;\n\npublic interface UndoList extends BlockList, Comparable {\n    public void commit();\n    public void undo();\n    public void undo(boolean undoEntityChanges);\n\n    public void setScheduleUndo(int ttl);\n    public int getScheduledUndo();\n    public boolean bypass();\n    public long getCreatedTime();\n    public long getModifiedTime();\n    public long getScheduledTime();\n    public boolean isScheduled();\n\n    public void prune();\n\n    public void add(Entity entity);\n    public void remove(Entity entity);\n    public EntityData modify(Entity entity);\n    public void add(Runnable runnable);\n\n    public void convert(Entity entity, Block block);\n    public void fall(Entity entity, Block block);\n    public void explode(Entity entity, List explodedBlocks);\n    public void cancelExplosion(Entity entity);\n\n    public boolean contains(Location location, int threshold);\n\n    public String getName();\n    public Mage getOwner();\n}\n","subject":"Return the EntityData on entity undo"}
{"old_contents":"\/* (c) 2014 LinkedIn Corp. All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n * this file except in compliance with the License. You may obtain a copy of the\n * License at  http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software distributed\n * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied.\n *\/\n\npackage com.linkedin.uif.fork;\n\nimport org.apache.avro.Schema;\n\n\/**\n * A wrapper class for {@link org.apache.avro.Schema} that is also {@link Copyable}.\n *\n * @author ynli\n *\/\npublic class CopyableSchema implements Copyable {\n\n    private final Schema schema;\n\n    public CopyableSchema(Schema schema) {\n        this.schema = schema;\n    }\n\n    @Override\n    public Schema copy() throws CopyNotSupportedException {\n        return new Schema.Parser().parse(this.schema.toString());\n    }\n}\n","new_contents":"\/* (c) 2014 LinkedIn Corp. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n * this file except in compliance with the License. You may obtain a copy of the\n * License at  http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed\n * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied.\n *\/\n\npackage com.linkedin.uif.fork;\n\nimport org.apache.avro.Schema;\n\n\n\/**\n * A wrapper class for {@link org.apache.avro.Schema} that is also {@link Copyable}.\n *\n * @author ynli\n *\/\npublic class CopyableSchema implements Copyable {\n\n  private final Schema schema;\n\n  public CopyableSchema(Schema schema) {\n    this.schema = schema;\n  }\n\n  @Override\n  public Schema copy()\n      throws CopyNotSupportedException {\n    return new Schema.Parser().setValidate(false).parse(this.schema.toString());\n  }\n}\n","subject":"Set validation to false when copying a schema"}
{"old_contents":"package fabzo.kraken;\n\nimport fabzo.kraken.components.DockerComponent;\nimport fabzo.kraken.handler.docker.DockerConfiguration;\nimport fabzo.kraken.handler.docker.DockerLifecycleHandler;\nimport fabzo.kraken.wait.MySQLWait;\nimport org.junit.Test;\n\nimport java.time.Duration;\n\npublic class WaitTest {\n\n    @Test\n    public void testDatabaseWait() {\n        final Environment environment = Kraken.createEnvironment(new EnvironmentModule() {\n            @Override\n            public void configure() {\n                register(DockerLifecycleHandler.withConfig(\n                        DockerConfiguration.create()\n                                .withDockerSocket(DockerConfiguration.DOCKER_HOST_UNIX)));\n\n                register(DockerComponent.create()\n                        .withName(\"mariadb\")\n                        .withImage(\"fabzo\/mariadb-docker\", \"delivery\")\n                        .withForcePull()\n                        .withFollowLogs()\n                        .withPortBinding(\"db\", 3306)\n                        .withEnv(\"MYSQL_DATABASE\", \"delivery\")\n                        .withEnv(\"MYSQL_ALLOW_EMPTY_PASSWORD\", \"yes\")\n                        .withWait(new MySQLWait(\"delivery\",\"db\", Duration.ofSeconds(60))));\n\n            }\n        });\n\n        try {\n            environment.start();\n        } catch (final Exception e) {\n            e.printStackTrace();\n        } finally {\n            environment.stop();\n        }\n    }\n}\n","new_contents":"package fabzo.kraken;\n\nimport fabzo.kraken.components.DockerComponent;\nimport fabzo.kraken.handler.docker.DockerConfiguration;\nimport fabzo.kraken.handler.docker.DockerLifecycleHandler;\nimport fabzo.kraken.wait.MySQLWait;\nimport org.junit.Test;\n\nimport java.time.Duration;\n\npublic class WaitTest {\n\n    @Test\n    public void testDatabaseWait() {\n        final Environment environment = Kraken.createEnvironment(new EnvironmentModule() {\n            @Override\n            public void configure() {\n                register(DockerLifecycleHandler.withConfig(\n                        DockerConfiguration.create()\n                                .withDockerSocket(DockerConfiguration.DOCKER_HOST_UNIX)));\n\n                register(DockerComponent.create()\n                        .withName(\"mariadb\")\n                        .withImage(\"fabzo\/mariadb-docker\", \"testdb\")\n                        .withForcePull()\n                        .withFollowLogs()\n                        .withPortBinding(\"db\", 3306)\n                        .withEnv(\"MYSQL_DATABASE\", \"testdb\")\n                        .withEnv(\"MYSQL_ALLOW_EMPTY_PASSWORD\", \"yes\")\n                        .withWait(new MySQLWait(\"testdb\",\"db\", Duration.ofSeconds(60))));\n\n            }\n        });\n\n        try {\n            environment.start();\n        } catch (final Exception e) {\n            e.printStackTrace();\n        } finally {\n            environment.stop();\n        }\n    }\n}\n","subject":"Use generic test db name"}
{"old_contents":"public class Codec {\n  private Map urlMapper = new HashMap<>();\n  private Random rand = new Random();\n  private byte[] stringArray = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\".getBytes();\n\n  \/\/ Encodes a URL to a shortened URL.\n  public String encode(String longUrl) {\n    String shortened = getShortUrl(longUrl);\n    urlMapper.put(shortened, longUrl);\n    return shortened;\n  }\n\n  \/\/ Decodes a shortened URL to its original URL.\n  public String decode(String shortUrl) {\n    return urlMapper.get(shortUrl);\n  }\n}\n\n","new_contents":"public class Codec {\n    private Map urlMapper = new HashMap<>();\n    private Random rand = new Random();\n    private byte[] stringArray = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\".getBytes();\n\n    private String getShortUrl() {\n      byte[] s = new byte[6];\n      for (int i = 0; i < 6; i++) {\n        int n = rand.nextInt(62);\n        s[i] = stringArray[n];\n      }\n      return \"http:\/\/tinyurl.com\/\" + new String(s);\n    }\n\n    \/\/ Encodes a URL to a shortened URL.\n    public String encode(String longUrl) {\n        String shortened = null;\n        int count = 0;\n        while (count < 10) {\n            shortened = getShortUrl();\n            if (urlMapper.get(shortened) == null) {\n                urlMapper.put(shortened, longUrl);\n                break;\n            }\n            count++;\n        }\n        return shortened;\n    }\n\n    \/\/ Decodes a shortened URL to its original URL.\n    public String decode(String shortUrl) {\n        return urlMapper.get(shortUrl);\n    }\n}\n\n","subject":"Update java solution for 'Encode and Decode TinyURL'"}
{"old_contents":"\/*\n * Copyright (C) 2009 Google Inc.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n * use this file except in compliance with the License. You may obtain a copy of\n * the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n *\/\n\npackage com.android.inputmethod.latin;\n\nimport android.app.backup.BackupHelperAgent;\nimport android.app.backup.SharedPreferencesBackupHelper;\n\n\/**\n * Backs up the Latin IME shared preferences.\n *\/\npublic class LatinIMEBackupAgent extends BackupHelperAgent {\n\n    public void onCreate() {\n        addHelper(\"shared_pref\", new SharedPreferencesBackupHelper(this,\n                getPackageName() + \"_preferences\"));\n    }\n}\n","new_contents":"\/*\n * Copyright (C) 2009 Google Inc.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n * use this file except in compliance with the License. You may obtain a copy of\n * the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n *\/\n\npackage com.android.inputmethod.latin;\n\nimport android.app.backup.BackupAgentHelper;\nimport android.app.backup.SharedPreferencesBackupHelper;\n\n\/**\n * Backs up the Latin IME shared preferences.\n *\/\npublic class LatinIMEBackupAgent extends BackupAgentHelper {\n\n    public void onCreate() {\n        addHelper(\"shared_pref\", new SharedPreferencesBackupHelper(this,\n                getPackageName() + \"_preferences\"));\n    }\n}\n","subject":"Fix build breakage due to api change"}
{"old_contents":"package com.twu.biblioteca;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\/**\n * Created by watsonarw on 16\/04\/15.\n *\/\npublic class LibraryTest {\n\n\n    @Test\n    public void testSingleBookLibrary() {\n        Library library = new Library();\n        library.addBook(\"The Hobbit\", \"J.R.R. Tolkien\", 1937);\n        assertEquals(\"The Hobbit - J.R.R. Tolkien, 1937\\n\",library.getBookList());\n    }\n\n\n    @Test\n    public void testMultiBookLibrary() {\n        Library library = new Library();\n        library.addBook(\"The Hobbit\", \"J.R.R. Tolkien\", 1937);\n        library.addBook(\"Catcher in the Rye\", \"J.D. Salinger\", 1951);\n        assertEquals(\"The Hobbit - J.R.R. Tolkien, 1937\\nCatcher in the Rye - J.D. Salinger, 1951\\n\",library.getBookList());\n    }\n}\n","new_contents":"package com.twu.biblioteca;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\/**\n * Created by watsonarw on 16\/04\/15.\n *\/\npublic class LibraryTest {\n\n\n    @Test\n    public void testSingleBookLibrary() {\n        Library library = new Library();\n        library.addBook(\"The Hobbit\", \"J.R.R. Tolkien\", 1937);\n        assertEquals(\" 1 | The Hobbit - J.R.R. Tolkien, 1937\\n\",library.getBookList());\n    }\n\n\n    @Test\n    public void testMultiBookLibrary() {\n        Library library = new Library();\n        library.addBook(\"The Hobbit\", \"J.R.R. Tolkien\", 1937);\n        library.addBook(\"Catcher in the Rye\", \"J.D. Salinger\", 1951);\n        assertEquals(\" 1 | The Hobbit - J.R.R. Tolkien, 1937\\n 2 | Catcher in the Rye - J.D. Salinger, 1951\\n\",library.getBookList());\n    }\n}\n","subject":"Update Expected Library test responses for numbering books"}
{"old_contents":"\/**\n * Copyright (c) 2016 Dr. Chris Senior.\n * See LICENSE.txt for licensing terms\n *\/\npackage com.asteroid.duck.osgi.example.album;\n\n\/**\n * Interface to a service that provides information about Underworld albums\n *\/\npublic interface AlbumInfoService {\n\n}\n","new_contents":"\/**\n * Copyright (c) 2016 Dr. Chris Senior.\n * See LICENSE.txt for licensing terms\n *\/\npackage com.asteroid.duck.osgi.example.album;\n\nimport java.util.List;\n\n\/**\n * Interface to a service that provides information about Underworld albums\n *\/\npublic interface AlbumInfoService {\n    List getAlbums();\n    List getTracks();\n}\n","subject":"Add API for album info service"}
{"old_contents":"\/*\n * Copyright (C) 2011 Benoit GUEROUT  and Yves AMSELLEM \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.jongo.bson;\n\nimport com.mongodb.DBObject;\nimport com.mongodb.LazyDBObject;\nimport org.bson.LazyBSONCallback;\n\nclass RelaxedLazyDBObject extends LazyDBObject implements BsonDocument {\n\n    public RelaxedLazyDBObject(byte[] data, LazyBSONCallback cbk) {\n        super(data, cbk);\n    }\n\n    public byte[] toByteArray() {\n        return _input.array();\n    }\n\n    public DBObject toDBObject() {\n        return this;\n    }\n\n    public int getSize() {\n        return getBSONSize();\n    }\n}\n","new_contents":"\/*\n * Copyright (C) 2011 Benoit GUEROUT  and Yves AMSELLEM \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.jongo.bson;\n\nimport com.mongodb.DBObject;\nimport com.mongodb.LazyDBObject;\nimport org.bson.LazyBSONCallback;\n\nclass RelaxedLazyDBObject extends LazyDBObject implements BsonDocument {\n\n    public RelaxedLazyDBObject(byte[] data, LazyBSONCallback cbk) {\n        super(data, cbk);\n    }\n\n    public byte[] toByteArray() {\n        return getBytes();\n    }\n\n    public DBObject toDBObject() {\n        return this;\n    }\n\n    public int getSize() {\n        return getBSONSize();\n    }\n}\n","subject":"Remove the use of a protected deprecated field"}
{"old_contents":"\/**\n * Created by Nathan_Zeplowitz on 4\/14\/15.\n *\/\npublic class GuessingGame {\n}\n","new_contents":"\/**\n * Created by Nathan_Zeplowitz on 4\/14\/15.\n *\/\npublic class GuessingGame {\n    public static void main(String[] args) {\n        RandomNumber randomNumber = new RandomNumber();\n        GameHelper helper = new GameHelper();\n        boolean guessCorrect = false;\n\n        while(!guessCorrect){\n            String userGuess = helper.getUserInput(\"Guess a Number Between 1 and 100:\");\n            String result = randomNumber.checkGuess(userGuess);\n\n            if (result.equals(\"Correct\")) {\n                guessCorrect = true;\n                System.out.println(\"Your guess was correct. You Win!\");\n                break;\n            }\n\n            System.out.println(result);\n\n        }\n    }\n\n}\n","subject":"Add Main Game With Checks for User Guesses"}
{"old_contents":"\/**\n * Created by Nathan_Zeplowitz on 4\/14\/15.\n *\/\npublic class RandomNumber {\n    private int number;\n\n    public RandomNumber(){\n        this.number = (int) (Math.random() * 100);\n    }\n\n    public int getNumber() {\n        return number;\n    }\n}\n","new_contents":"\/**\n * Created by Nathan_Zeplowitz on 4\/14\/15.\n *\/\npublic class RandomNumber {\n    private int number;\n\n    public RandomNumber(){\n        this.number = (int) (Math.random() * 100);\n    }\n\n    public int getNumber() {\n        return number;\n    }\n\n    public String checkGuess(String userGuess) {\n        int guess = Integer.parseInt(userGuess);\n\n        if (guess == getNumber()) {\n            return \"Correct\";\n        } else if (guess < getNumber()) {\n            return \"Your guess was too low.\";\n        } else {\n            return \"Your guess was too high.\";\n        }\n    }\n}\n","subject":"Add CheckGuess Method to Random Number"}
{"old_contents":"package de.sormuras.bach.util;\n\nimport java.util.Map;\nimport java.util.NoSuchElementException;\nimport java.util.ServiceLoader;\nimport java.util.TreeMap;\nimport java.util.function.Consumer;\nimport java.util.spi.ToolProvider;\n\n\/** Tool registry. *\/\npublic class Tools {\n\n  final Map map;\n\n  public Tools() {\n    this.map = new TreeMap<>();\n    ServiceLoader.load(ToolProvider.class).stream()\n        .map(ServiceLoader.Provider::get)\n        .forEach(provider -> map.putIfAbsent(provider.name(), provider));\n  }\n\n  public ToolProvider get(String name) {\n    var tool = map.get(name);\n    if (tool == null) {\n      throw new NoSuchElementException(\"No such tool: \" + name);\n    }\n    return tool;\n  }\n\n  public void forEach(Consumer action) {\n    map.values().forEach(action);\n  }\n}\n","new_contents":"package de.sormuras.bach.util;\n\nimport java.util.Map;\nimport java.util.NoSuchElementException;\nimport java.util.ServiceLoader;\nimport java.util.TreeMap;\nimport java.util.function.Consumer;\nimport java.util.spi.ToolProvider;\n\n\/** Tool registry. *\/\npublic class Tools {\n\n  final Map map;\n\n  public Tools() {\n    this.map = new TreeMap<>();\n    ServiceLoader.load(ToolProvider.class, ClassLoader.getSystemClassLoader()).stream()\n        .map(ServiceLoader.Provider::get)\n        .forEach(provider -> map.putIfAbsent(provider.name(), provider));\n  }\n\n  public ToolProvider get(String name) {\n    var tool = map.get(name);\n    if (tool == null) {\n      throw new NoSuchElementException(\"No such tool: \" + name);\n    }\n    return tool;\n  }\n\n  public void forEach(Consumer action) {\n    map.values().forEach(action);\n  }\n}\n","subject":"Use system (application) class loader to load tool providers"}
{"old_contents":"\/*\n * Copyright 2013-2015 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.cloudfoundry.operations;\n\nimport org.junit.Test;\n\nimport static org.cloudfoundry.operations.ValidationResult.Status.VALID;\nimport static org.junit.Assert.assertEquals;\n\npublic final class ListRoutesRequestTest {\n\n    @Test\n    public void isValid() {\n        ValidationResult result = ListRoutesRequest.builder()\n                .level(ListRoutesRequest.Level.Organization)\n                .build()\n                .isValid();\n\n        assertEquals(VALID, result.getStatus());\n    }\n\n}\n","new_contents":"\/*\n * Copyright 2013-2015 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.cloudfoundry.operations;\n\nimport org.junit.Test;\n\nimport static org.cloudfoundry.operations.ValidationResult.Status.VALID;\nimport static org.junit.Assert.assertEquals;\n\npublic final class ListRoutesRequestTest {\n\n    @Test\n    public void isValid() {\n        ValidationResult result = ListRoutesRequest.builder()\n                .level(ListRoutesRequest.Level.Organization)\n                .build()\n                .isValid();\n\n        assertEquals(VALID, result.getStatus());\n    }\n\n    @Test\n    public void isValidNoLevel() {\n        ValidationResult result = ListRoutesRequest.builder()\n                .build()\n                .isValid();\n\n        assertEquals(VALID, result.getStatus());\n    }\n\n}\n","subject":"Add test for level being omitted on Routes operation."}
{"old_contents":"\/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\/\r\n\r\npackage java.util.jar;\r\n\r\n\r\nimport java.util.zip.ZipException;\r\n\r\n\/**\r\n * This runtime exception is thrown when a problem occurrs while reading a JAR\r\n * file.\r\n * \r\n *\/\r\npublic class JarException extends ZipException {\r\n\r\n\t\/**\r\n\t * Constructs a new instance of this class with its walkback filled in.\r\n\t *\/\r\n\tpublic JarException() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\t\/**\r\n\t * Constructs a new instance of this class with its walkback and message\r\n\t * filled in.\r\n\t * \r\n\t * @param detailMessage\r\n\t *            String The detail message for the exception.\r\n\t *\/\r\n\tpublic JarException(String detailMessage) {\r\n\t\tsuper(detailMessage);\r\n\t}\r\n}\r\n","new_contents":"\/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\/\r\n\r\npackage java.util.jar;\r\n\r\nimport java.util.zip.ZipException;\r\n\r\n\/**\r\n * This runtime exception is thrown when a problem occurrs while reading a JAR\r\n * file.\r\n *\/\r\npublic class JarException extends ZipException {\r\n\r\n    private static final long serialVersionUID = 7159778400963954473L;\r\n\r\n    \/**\r\n     * Constructs a new instance of this class with its walkback filled in.\r\n     *\/\r\n    public JarException() {\r\n        super();\r\n    }\r\n\r\n    \/**\r\n     * Constructs a new instance of this class with its walkback and message\r\n     * filled in.\r\n     * \r\n     * @param detailMessage\r\n     *            String The detail message for the exception.\r\n     *\/\r\n    public JarException(String detailMessage) {\r\n        super(detailMessage);\r\n    }\r\n}\r\n","subject":"Add constant SUID and minor reformatting"}
{"old_contents":"package org.multibit.hd.core.dto;\n\n\/**\n * 

Enum to provide the following to various UI models:<\/p>\n *

    \n *
  • High level wallet type selection (standard, Trezor, KeepKey etc)<\/li>\n * <\/ul>\n *\n *

    This reduces code complexity in factory methods when deciding how to build supporting objects<\/p>\n *\n * @since 0.0.1\n *\n *\/\npublic enum WalletMode {\n\n \/**\n * Target a standard soft wallet (BIP 32 or BIP 44)\n *\/\n STANDARD,\n\n \/**\n * Target a Trezor wallet (BIP 44 only)\n *\/\n TREZOR,\n\n \/**\n * Target a KeepKey wallet (BIP 44 only)\n *\/\n KEEP_KEY,\n\n \/\/ End of enum\n ;\n\n}\n","new_contents":"package org.multibit.hd.core.dto;\n\n\/**\n *

    Enum to provide the following to various UI models:<\/p>\n *

      \n *
    • High level wallet type selection (standard, Trezor, KeepKey etc)<\/li>\n * <\/ul>\n *\n *

      This reduces code complexity in factory methods when deciding how to build supporting objects<\/p>\n *\n * @since 0.0.1\n *\/\npublic enum WalletMode {\n\n \/**\n * Target a standard soft wallet (BIP 32 or BIP 44)\n *\/\n STANDARD(\"MultiBit\"),\n\n \/**\n * Target a Trezor wallet (BIP 44 only)\n *\/\n TREZOR(\"Trezor\"),\n\n \/**\n * Target a KeepKey wallet (BIP 44 only)\n *\/\n KEEP_KEY(\"KeepKey\"),\n\n \/\/ End of enum\n ;\n\n private final String brand;\n\n WalletMode(String brand) {\n this.brand = brand;\n }\n\n \/**\n * @return The brand name for use with localisation\n *\/\n public String brand() {\n return brand;\n }\n}\n","subject":"Add support for brand names in message keys to reduce translation burden"} {"old_contents":"\/**\n * Copyright 2015 Smart Community Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage it.smartcommunitylab.carpooling.mongo.repos;\n\nimport it.smartcommunitylab.carpooling.model.Travel;\n\nimport java.util.List;\n\nimport org.springframework.data.mongodb.repository.MongoRepository;\nimport org.springframework.data.mongodb.repository.Query;\n\npublic interface TravelRepository extends MongoRepository, TravelRepositoryCustom { \n\n\t@Query(\"{'userId':?0}\")\n\tList findTravelByDriverId(String userId);\n\n\t@Query(\"{'id':?0, 'userId':?1}\")\n\tTravel findTravelByIdAndDriverId(String id, String userId);\n\t\n}\n","new_contents":"\/**\n * Copyright 2015 Smart Community Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage it.smartcommunitylab.carpooling.mongo.repos;\n\nimport it.smartcommunitylab.carpooling.model.Travel;\n\nimport java.util.List;\n\nimport org.springframework.data.domain.Page;\nimport org.springframework.data.domain.Pageable;\nimport org.springframework.data.mongodb.repository.Query;\nimport org.springframework.data.repository.PagingAndSortingRepository;\n\npublic interface TravelRepository extends PagingAndSortingRepository, TravelRepositoryCustom { \n\n\t@Query(\"{'userId':?0}\")\n\tList findTravelByDriverId(String userId);\n\t\n\t@Query(\"{'userId':?0}\")\n\tPage findTravelByDriverId(String userId, Pageable pageable);\n\n\t@Query(\"{'id':?0, 'userId':?1}\")\n\tTravel findTravelByIdAndDriverId(String id, String userId);\n\t\n}\n","subject":"Fix for usage of PagingAndSortingRepository"} {"old_contents":"package name.matco.simcity.api;\n\nimport javax.ws.rs.ext.ContextResolver;\nimport javax.ws.rs.ext.Provider;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.databind.SerializationFeature;\n\n@Provider\npublic class ObjectMapperResolver implements ContextResolver {\n\n\tprivate final ObjectMapper mapper;\n\n\tpublic ObjectMapperResolver() {\n\t\tmapper = new ObjectMapper();\n\t\tmapper.enable(SerializationFeature.INDENT_OUTPUT);\n\t}\n\n\t@Override\n\tpublic ObjectMapper getContext(final Class type) {\n\t\treturn mapper;\n\t}\n}\n","new_contents":"package name.matco.simcity.api;\n\nimport java.io.IOException;\n\nimport javax.ws.rs.core.MultivaluedMap;\nimport javax.ws.rs.ext.ContextResolver;\nimport javax.ws.rs.ext.Provider;\n\nimport com.fasterxml.jackson.core.JsonGenerator;\nimport com.fasterxml.jackson.core.util.DefaultIndenter;\nimport com.fasterxml.jackson.core.util.DefaultPrettyPrinter;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.databind.ObjectWriter;\nimport com.fasterxml.jackson.jaxrs.cfg.EndpointConfigBase;\nimport com.fasterxml.jackson.jaxrs.cfg.ObjectWriterInjector;\nimport com.fasterxml.jackson.jaxrs.cfg.ObjectWriterModifier;\n\n@Provider\npublic class ObjectMapperResolver implements ContextResolver {\n\n\tprivate final ObjectMapper mapper;\n\n\tpublic ObjectMapperResolver() {\n\t\tmapper = new ObjectMapper();\n\t\tObjectWriterInjector.set(new ObjectWriterModifier() {\n\t\t\t@Override\n\t\t\tpublic ObjectWriter modify(final EndpointConfigBase endpoint, final MultivaluedMap responseHeaders, final Object valueToWrite, final ObjectWriter w, final JsonGenerator g) throws IOException {\n\t\t\t\tfinal DefaultPrettyPrinter pp = new DefaultPrettyPrinter();\n\t\t\t\tpp.indentObjectsWith(new DefaultIndenter(\"\\t\", \"\\n\"));\n\t\t\t\tg.setPrettyPrinter(pp);\n\t\t\t\treturn w;\n\t\t\t}\n\t\t});\n\t}\n\n\t@Override\n\tpublic ObjectMapper getContext(final Class type) {\n\t\treturn mapper;\n\t}\n}\n","subject":"Improve indentation of JSON content from REST API"} {"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n *\/\n\npackage org.apache.jmeter.threads;\n\nimport junit.framework.TestCase;\n\npublic class TestJMeterContextService extends TestCase {\n\n public TestJMeterContextService(String name) {\n super(name);\n }\n\n \/\/ Give access to the method for test code\n public static void incrNumberOfThreads(){\n JMeterContextService.incrNumberOfThreads();\n }\n \/\/ Give access to the method for test code\n public static void decrNumberOfThreads(){\n JMeterContextService.decrNumberOfThreads();\n }\n}\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n *\/\n\npackage org.apache.jmeter.threads;\n\nimport junit.framework.TestCase;\n\npublic class TestJMeterContextService extends TestCase {\n\n public TestJMeterContextService(String name) {\n super(name);\n }\n\n public void testCounts(){\n assertEquals(0,JMeterContextService.getNumberOfThreads());\n assertEquals(0,JMeterContextService.getTotalThreads());\n incrNumberOfThreads();\n assertEquals(1,JMeterContextService.getNumberOfThreads());\n assertEquals(0,JMeterContextService.getTotalThreads());\n decrNumberOfThreads();\n assertEquals(0,JMeterContextService.getTotalThreads());\n assertEquals(0,JMeterContextService.getNumberOfThreads());\n JMeterContextService.addTotalThreads(27);\n JMeterContextService.addTotalThreads(27);\n assertEquals(54,JMeterContextService.getTotalThreads());\n assertEquals(0,JMeterContextService.getNumberOfThreads());\n }\n \n \/\/ Give access to the method for test code\n public static void incrNumberOfThreads(){\n JMeterContextService.incrNumberOfThreads();\n }\n \/\/ Give access to the method for test code\n public static void decrNumberOfThreads(){\n JMeterContextService.decrNumberOfThreads();\n }\n}\n","subject":"Create some tests for JMeterContextService"} {"old_contents":"package eu.europa.esig.dss.validation.process.qmatrix;\n\nimport java.util.Date;\n\nimport javax.xml.bind.DatatypeConverter;\n\npublic final class EIDASUtils {\n\n\tprivate EIDASUtils() {\n\t}\n\n\t\/**\n\t * Start date of the eIDAS regularisation\n\t *\/\n\tprivate final static Date EIDAS_DATE = DatatypeConverter.parseDateTime(\"2016-07-01T00:00:00.000Z\").getTime();\n\n\t\/**\n\t * End of the grace period for eIDAS regularisation\n\t *\/\n\tprivate final static Date EIDAS_GRACE_DATE = DatatypeConverter.parseDateTime(\"2017-07-01T00:00:00.000Z\").getTime();\n\n\tpublic static boolean isPostEIDAS(Date date) {\n\t\treturn date != null && date.compareTo(EIDAS_DATE) >= 0;\n\t}\n\n\tpublic static boolean isPreEIDAS(Date date) {\n\t\treturn date != null && date.compareTo(EIDAS_DATE) < 0;\n\t}\n\n\tpublic static boolean isPostGracePeriod(Date date) {\n\t\treturn date != null && date.compareTo(EIDAS_GRACE_DATE) >= 0;\n\t}\n\n}\n","new_contents":"package eu.europa.esig.dss.validation.process.qmatrix;\n\nimport java.util.Date;\n\nimport javax.xml.bind.DatatypeConverter;\n\npublic final class EIDASUtils {\n\n\tprivate EIDASUtils() {\n\t}\n\n\t\/**\n\t * Start date of the eIDAS regulation\n\t * \n\t * Regulation was signed in Brussels : 1st of July 00:00 Brussels = 30th of June 22:00 UTC\n\t *\/\n\tprivate final static Date EIDAS_DATE = DatatypeConverter.parseDateTime(\"2016-06-30T22:00:00.000Z\").getTime();\n\n\t\/**\n\t * End of the grace period for eIDAS regulation\n\t *\/\n\tprivate final static Date EIDAS_GRACE_DATE = DatatypeConverter.parseDateTime(\"2017-06-30T22:00:00.000Z\").getTime();\n\n\tpublic static boolean isPostEIDAS(Date date) {\n\t\treturn date != null && date.compareTo(EIDAS_DATE) >= 0;\n\t}\n\n\tpublic static boolean isPreEIDAS(Date date) {\n\t\treturn date != null && date.compareTo(EIDAS_DATE) < 0;\n\t}\n\n\tpublic static boolean isPostGracePeriod(Date date) {\n\t\treturn date != null && date.compareTo(EIDAS_GRACE_DATE) >= 0;\n\t}\n\n}\n","subject":"Fix eIDAS date (Brussels date is used)"} {"old_contents":"package info.u_team.u_team_test.init;\n\nimport info.u_team.u_team_test.TestMod;\nimport net.minecraftforge.event.entity.EntityTravelToDimensionEvent;\nimport net.minecraftforge.event.world.RegisterDimensionsEvent;\nimport net.minecraftforge.eventbus.api.SubscribeEvent;\nimport net.minecraftforge.fml.common.Mod.EventBusSubscriber;\nimport net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;\nimport net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent;\n\n@EventBusSubscriber(modid = TestMod.MODID, bus = Bus.FORGE)\npublic class TestDimensions {\n\t\n\t@SubscribeEvent\n\tpublic static void on(RegisterDimensionsEvent event) {\n\t\t\/\/ Dimension are broken currently\n\t\t\/\/ if (!DimensionManager.getRegistry().containsKey(TestModDimensions.BASIC.getRegistryName())) { \/\/ How do we know when\n\t\t\/\/ the dimension needs to be registered??\n\t\t\/\/ DimensionManager.registerDimension(TestModDimensions.BASIC.getRegistryName(), TestModDimensions.BASIC, null, true);\n\t\t\/\/ }\n\t}\n\t\n\t@SubscribeEvent\n\tpublic static void on(EntityTravelToDimensionEvent event) {\n\t\tSystem.out.println(\"START TRAVELING TO \" + event.getDimension() + \" AS \" + event.getEntity());\n\t}\n\t\n\t@SubscribeEvent\n\tpublic static void on(PlayerChangedDimensionEvent event) {\n\t\tSystem.out.println(\"FINISHED TRAVELING TO: \" + event.getTo() + \" FROM \" + event.getFrom() + \" AS \" + event.getPlayer());\n\t}\n\t\n}\n","new_contents":"package info.u_team.u_team_test.init;\n\nimport info.u_team.u_team_test.TestMod;\nimport net.minecraftforge.event.entity.EntityTravelToDimensionEvent;\nimport net.minecraftforge.event.entity.player.PlayerEvent.PlayerChangedDimensionEvent;\nimport net.minecraftforge.event.world.RegisterDimensionsEvent;\nimport net.minecraftforge.eventbus.api.SubscribeEvent;\nimport net.minecraftforge.fml.common.Mod.EventBusSubscriber;\nimport net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;\n\n@EventBusSubscriber(modid = TestMod.MODID, bus = Bus.FORGE)\npublic class TestDimensions {\n\t\n\t@SubscribeEvent\n\tpublic static void on(RegisterDimensionsEvent event) {\n\t\t\/\/ Dimension are broken currently\n\t\t\/\/ if (!DimensionManager.getRegistry().containsKey(TestModDimensions.BASIC.getRegistryName())) { \/\/ How do we know when\n\t\t\/\/ the dimension needs to be registered??\n\t\t\/\/ DimensionManager.registerDimension(TestModDimensions.BASIC.getRegistryName(), TestModDimensions.BASIC, null, true);\n\t\t\/\/ }\n\t}\n\t\n\t@SubscribeEvent\n\tpublic static void on(EntityTravelToDimensionEvent event) {\n\t\tSystem.out.println(\"START TRAVELING TO \" + event.getDimension() + \" AS \" + event.getEntity());\n\t}\n\t\n\t@SubscribeEvent\n\tpublic static void on(PlayerChangedDimensionEvent event) {\n\t\tSystem.out.println(\"FINISHED TRAVELING TO: \" + event.getTo() + \" FROM \" + event.getFrom() + \" AS \" + event.getPlayer());\n\t}\n\t\n}\n","subject":"Fix compile error due to new forge version"} {"old_contents":"package cpw.mods.fml.relauncher;\n\nimport java.security.Permission;\n\n\/**\n * A custom security manager stopping certain events from happening\n * unexpectedly.\n *\n * @author cpw\n *\n *\/\npublic class FMLSecurityManager extends SecurityManager {\n @Override\n public void checkPermission(Permission perm)\n {\n String permName = perm.getName() != null ? perm.getName() : \"missing\";\n if (permName.startsWith(\"exitVM\"))\n {\n String callingClass = getClassContext()[4].getName();\n \/\/ FML is allowed to call system exit\n if (!callingClass.startsWith(\"cpw.mods.fml.\"))\n {\n throw new ExitTrappedException();\n }\n }\n else if (\"setSecurityManager\".equals(permName))\n {\n throw new SecurityException(\"Cannot replace the FML security manager\");\n }\n return;\n }\n\n public static class ExitTrappedException extends SecurityException {\n private static final long serialVersionUID = 1L;\n }\n}\n","new_contents":"package cpw.mods.fml.relauncher;\n\nimport java.security.Permission;\n\n\/**\n * A custom security manager stopping certain events from happening\n * unexpectedly.\n *\n * @author cpw\n *\n *\/\npublic class FMLSecurityManager extends SecurityManager {\n @Override\n public void checkPermission(Permission perm)\n {\n String permName = perm.getName() != null ? perm.getName() : \"missing\";\n if (permName.startsWith(\"exitVM\"))\n {\n Class[] classContexts = getClassContext();\n String callingClass = classContexts.length > 3 ? classContexts[4].getName() : \"none\";\n String callingParent = classContexts.length > 4 ? classContexts[5].getName() : \"none\";\n \/\/ FML is allowed to call system exit and the Minecraft applet (from the quit button)\n if (!(callingClass.startsWith(\"cpw.mods.fml.\") || ( \"net.minecraft.client.Minecraft\".equals(callingClass) && \"net.minecraft.client.Minecraft\".equals(callingParent)) || (\"net.minecraft.server.dedicated.DedicatedServer\".equals(callingClass) && \"net.minecraft.server.MinecraftServer\".equals(callingParent))))\n {\n throw new ExitTrappedException();\n }\n }\n else if (\"setSecurityManager\".equals(permName))\n {\n throw new SecurityException(\"Cannot replace the FML security manager\");\n }\n return;\n }\n\n public static class ExitTrappedException extends SecurityException {\n private static final long serialVersionUID = 1L;\n }\n}\n","subject":"Fix up other exit points. Should stop process hangs for clean exits."} {"old_contents":"\/*\n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage edu.wpi.first.wpilibj.technobots.commands;\n\nimport edu.wpi.first.wpilibj.command.CommandGroup;\n\n\/**\n *\n * @author miguel\n *\/\npublic class NormalAutonomous extends CommandGroup {\n\n public NormalAutonomous() {\n\n \/\/addSequential(new StopBall());\n addParallel(new ShooterOn(-.8));\n addSequential(new ReleaseBall());\n addSequential(new StopBall());\n\n\n }\n}\n","new_contents":"\/*\n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage edu.wpi.first.wpilibj.technobots.commands;\n\nimport edu.wpi.first.wpilibj.command.CommandGroup;\n\n\/**\n *\n * @author miguel\n *\/\npublic class NormalAutonomous extends CommandGroup {\n\n public NormalAutonomous() {\n\n \/\/addSequential(new StopBall());\n addParallel(new ShooterOn(-.6));\n addSequential(new ReleaseBall());\n addSequential(new StopBall());\n\n\n }\n}\n","subject":"Change speed for shooter in autonomous."} {"old_contents":"package org.opencds.cqf.config;\n\nimport ca.uhn.fhir.jpa.rp.dstu3.LibraryResourceProvider;\n\nimport org.cqframework.cql.cql2elm.FhirLibrarySourceProvider;\nimport org.cqframework.cql.cql2elm.LibrarySourceProvider;\nimport org.hl7.elm.r1.VersionedIdentifier;\nimport org.hl7.fhir.dstu3.model.Attachment;\nimport org.hl7.fhir.dstu3.model.IdType;\nimport org.hl7.fhir.dstu3.model.Library;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\n\/**\n * Created by Christopher on 1\/12\/2017.\n *\/\npublic class STU3LibrarySourceProvider implements LibrarySourceProvider {\n\n private LibraryResourceProvider provider;\n private FhirLibrarySourceProvider innerProvider;\n\n public STU3LibrarySourceProvider(LibraryResourceProvider provider) {\n this.provider = provider;\n this.innerProvider = new FhirLibrarySourceProvider();\n }\n\n @Override\n public InputStream getLibrarySource(VersionedIdentifier versionedIdentifier) {\n Library lib = provider.getDao().read(new IdType(versionedIdentifier.getId()));\n\n if (lib != null) {\n for (Attachment content : lib.getContent()) {\n if (content.getContentType().equals(\"text\/cql\")) {\n return new ByteArrayInputStream(content.getData());\n }\n }\n }\n\n return this.innerProvider.getLibrarySource(versionedIdentifier);\n }\n}","new_contents":"package org.opencds.cqf.config;\n\nimport ca.uhn.fhir.jpa.rp.dstu3.LibraryResourceProvider;\n\nimport org.cqframework.cql.cql2elm.FhirLibrarySourceProvider;\nimport org.cqframework.cql.cql2elm.LibrarySourceProvider;\nimport org.hl7.elm.r1.VersionedIdentifier;\nimport org.hl7.fhir.dstu3.model.Attachment;\nimport org.hl7.fhir.dstu3.model.IdType;\nimport org.hl7.fhir.dstu3.model.Library;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\n\/**\n * Created by Christopher on 1\/12\/2017.\n *\/\npublic class STU3LibrarySourceProvider implements LibrarySourceProvider {\n\n private LibraryResourceProvider provider;\n private FhirLibrarySourceProvider innerProvider;\n\n public STU3LibrarySourceProvider(LibraryResourceProvider provider) {\n this.provider = provider;\n this.innerProvider = new FhirLibrarySourceProvider();\n }\n\n @Override\n public InputStream getLibrarySource(VersionedIdentifier versionedIdentifier) {\n try {\n Library lib = provider.getDao().read(new IdType(versionedIdentifier.getId()));\n for (Attachment content : lib.getContent()) {\n if (content.getContentType().equals(\"text\/cql\")) {\n return new ByteArrayInputStream(content.getData());\n }\n }\n }\n catch(Exception e){}\n\n return this.innerProvider.getLibrarySource(versionedIdentifier);\n }\n}","subject":"Put exception eating back in"} {"old_contents":"package com.insightfullogic.lambdabehave.expectations;\n\nimport org.hamcrest.Matcher;\nimport org.hamcrest.Matchers;\n\nimport static org.junit.Assert.assertThat;\nimport static org.junit.Assert.assertTrue;\n\n\/**\n * .\n *\/\npublic final class StringExpectation extends BoundExpectation {\n public StringExpectation(final String str, final boolean positive) {\n super(str, positive);\n }\n\n public StringExpectation isEmptyString() {\n return matches(Matchers.isEmptyString());\n }\n\n public StringExpectation isEmptyOrNullString() {\n return matches(Matchers.isEmptyOrNullString());\n }\n\n public StringExpectation equalToIgnoringCase(final String expectedString) {\n return matches(Matchers.equalToIgnoringCase(expectedString));\n }\n\n public StringExpectation equalToIgnoringWhiteSpace(final String expectedString) {\n return matches(Matchers.equalToIgnoringWhiteSpace(expectedString));\n }\n\n public StringExpectation containsString(final String substring) {\n return matches(Matchers.containsString(substring));\n }\n\n public StringExpectation endsWith(final String suffix) {\n return matches(Matchers.endsWith(suffix));\n }\n\n public StringExpectation startsWith(final String prefix) {\n return matches(Matchers.startsWith(prefix));\n }\n\n private StringExpectation matches(final Matcher matcher) {\n assertThat(objectUnderTest, matcher);\n return this;\n }\n\n public StringExpectation matches(String regex) {\n assertTrue(objectUnderTest.matches(regex));\n return this;\n }\n\n}\n","new_contents":"package com.insightfullogic.lambdabehave.expectations;\n\nimport org.hamcrest.Matcher;\nimport org.hamcrest.Matchers;\n\nimport static org.junit.Assert.assertThat;\nimport static org.junit.Assert.assertTrue;\n\n\/**\n * .\n *\/\npublic final class StringExpectation extends BoundExpectation {\n public StringExpectation(final String str, final boolean positive) {\n super(str, positive);\n }\n\n public StringExpectation isEmptyString() {\n return matches(Matchers.isEmptyString());\n }\n\n public StringExpectation isEmptyOrNullString() {\n return matches(Matchers.isEmptyOrNullString());\n }\n\n public StringExpectation equalToIgnoringCase(final String expectedString) {\n return matches(Matchers.equalToIgnoringCase(expectedString));\n }\n\n public StringExpectation equalToIgnoringWhiteSpace(final String expectedString) {\n return matches(Matchers.equalToIgnoringWhiteSpace(expectedString));\n }\n\n public StringExpectation containsString(final String substring) {\n return matches(Matchers.containsString(substring));\n }\n\n public StringExpectation endsWith(final String suffix) {\n return matches(Matchers.endsWith(suffix));\n }\n\n public StringExpectation startsWith(final String prefix) {\n return matches(Matchers.startsWith(prefix));\n }\n\n private StringExpectation matches(final Matcher matcher) {\n assertThat(objectUnderTest, matcher);\n return this;\n }\n\n public StringExpectation matches(String regex) {\n assertTrue(\"String \" + objectUnderTest + \" does not match regex \" + regex, objectUnderTest.matches(regex));\n return this;\n }\n\n}\n","subject":"Add failure message when testing whether a string matches a regex"} {"old_contents":"\/*\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.facebook.buck.util.zip.collect;\n\nimport com.facebook.buck.core.util.immutables.BuckStyleValue;\nimport java.nio.file.Path;\nimport org.immutables.value.Value;\n\n\/** A source for a zip file entry that represents an entry for another zip file. *\/\n@BuckStyleValue\n@Value.Immutable(builder = false, copy = false, prehash = true)\npublic interface ZipEntrySourceFromZip extends ZipEntrySource {\n\n \/** Path to the source zip file. *\/\n @Override\n Path getSourceFilePath();\n\n \/** The name of the entry *\/\n @Override\n String getEntryName();\n\n \/** Position of the entry in the list of entries. *\/\n int getEntryPosition();\n}\n","new_contents":"\/*\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.facebook.buck.util.zip.collect;\n\nimport com.facebook.buck.core.util.immutables.BuckStylePrehashedValue;\nimport java.nio.file.Path;\n\n\/** A source for a zip file entry that represents an entry for another zip file. *\/\n@BuckStylePrehashedValue\npublic interface ZipEntrySourceFromZip extends ZipEntrySource {\n\n \/** Path to the source zip file. *\/\n @Override\n Path getSourceFilePath();\n\n \/** The name of the entry *\/\n @Override\n String getEntryName();\n\n \/** Position of the entry in the list of entries. *\/\n int getEntryPosition();\n}\n","subject":"Use BuckStylePrehashedValue instead of overriding BuckStyleValue"} {"old_contents":"\/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.jboss.gwt.elemento.core;\n\nimport elemental2.dom.HTMLElement;\n\n\/**\n * Convenience class to support lazy element creation. The bulk of a LazyElement is not instantiated until {@link\n * #element()} is called.\n *\/\npublic abstract class LazyElement implements IsElement {\n\n private HTMLElement element;\n\n \/**\n * Creates and returns the element on demand by calling {@link #createElement()} or just returns the previously\n * created element.\n *\/\n @Override\n public HTMLElement element() {\n if (element == null) {\n element = createElement();\n }\n return element;\n }\n\n \/**\n * Create the element contained within the {@link LazyElement}.\n *\n * @return the lazy element\n *\/\n protected abstract HTMLElement createElement();\n\n \/** @return whether the element was already created *\/\n protected boolean initialized() {\n return element != null;\n }\n}\n","new_contents":"\/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.jboss.gwt.elemento.core;\n\nimport elemental2.dom.HTMLElement;\n\n\/**\n * Convenience class to support lazy element creation. The bulk of a LazyElement is not instantiated until {@link\n * #element()} is called.\n *\/\npublic abstract class LazyElement implements IsElement {\n\n private HTMLElement element;\n\n \/**\n * Creates and returns the element on demand by calling {@link #createElement()} or just returns the previously\n * created element.\n *\/\n @Override\n public HTMLElement element() {\n if (element == null) {\n element = createElement();\n }\n return element;\n }\n\n \/** @deprecated use {@link #element()} instead. *\/\n @Override\n @Deprecated\n public HTMLElement asElement() {\n return element();\n }\n\n \/**\n * Create the element contained within the {@link LazyElement}.\n *\n * @return the lazy element\n *\/\n protected abstract HTMLElement createElement();\n\n \/** @return whether the element was already created *\/\n protected boolean initialized() {\n return element != null;\n }\n}\n","subject":"Make API changes backward compatible"} {"old_contents":"package src;\n\n\/**\n * Created by roxane on 03\/10\/2016.\n *\/\npublic class test {\n public static void main(String[] args) {\n System.out.println(\"Hello world\");\n }\n}\n","new_contents":"public class test {\n public static void main(String[] args) {\n System.out.println(\"Hello world\");\n }\n}\n","subject":"Create Java package inside src\/ folder"} {"old_contents":"package jetbrains.buildServer.clouds.azure;\n\nimport jetbrains.buildServer.serverSide.BuildAgentEx;\nimport jetbrains.buildServer.serverSide.BuildServerAdapter;\nimport jetbrains.buildServer.serverSide.SBuildAgent;\nimport jetbrains.buildServer.util.StringUtil;\nimport org.jetbrains.annotations.NotNull;\n\nimport java.util.Map;\n\n\/**\n * Changes name of authorized agents by cloud integration.\n *\/\npublic class AzureAgentNameChanger extends BuildServerAdapter {\n\n private static final String AUTHORIZATION_MESSAGE = \"Virtual agent is authorized automatically\";\n\n @Override\n public void agentStatusChanged(@NotNull SBuildAgent agent, boolean wasEnabled, boolean wasAuthorized) {\n if (!(agent instanceof BuildAgentEx)) {\n return;\n }\n\n \/\/ Check that it's an authorized virtual agent\n final String comment = agent.getAuthorizeComment().getComment();\n if (!agent.isAuthorized() || comment == null || !comment.contains(AUTHORIZATION_MESSAGE)) {\n return;\n }\n\n \/\/ Check that it's an azure agent\n final Map config = agent.getConfigurationParameters();\n final String agentName = config.get(AzurePropertiesNames.INSTANCE_NAME);\n if (StringUtil.isEmpty(agentName)) {\n return;\n }\n\n \/\/ Set name\n final BuildAgentEx buildAgent = (BuildAgentEx) agent;\n buildAgent.setName(agentName);\n }\n}\n","new_contents":"package jetbrains.buildServer.clouds.azure;\n\nimport jetbrains.buildServer.serverSide.BuildAgentEx;\nimport jetbrains.buildServer.serverSide.BuildServerAdapter;\nimport jetbrains.buildServer.serverSide.SBuildAgent;\nimport jetbrains.buildServer.util.StringUtil;\nimport org.jetbrains.annotations.NotNull;\n\nimport java.util.Map;\n\n\/**\n * Changes name of authorized agents by cloud integration.\n *\/\npublic class AzureAgentNameChanger extends BuildServerAdapter {\n\n private static final String AUTHORIZATION_MESSAGE = \"Virtual agent is authorized automatically\";\n\n @Override\n public void agentStatusChanged(@NotNull SBuildAgent agent, boolean wasEnabled, boolean wasAuthorized) {\n if (!(agent instanceof BuildAgentEx)) {\n return;\n }\n\n \/\/ Check that it's an authorized virtual agent\n final String comment = agent.getAuthorizeComment().getComment();\n if (!agent.isAuthorized() || comment == null || !comment.contains(AUTHORIZATION_MESSAGE)) {\n return;\n }\n\n \/\/ Check that it's an azure agent\n final Map config = agent.getConfigurationParameters();\n final String agentName = config.get(AzurePropertiesNames.INSTANCE_NAME);\n if (StringUtil.isEmpty(agentName) || agentName.equals(agent.getName())) {\n return;\n }\n\n \/\/ Set name\n final BuildAgentEx buildAgent = (BuildAgentEx) agent;\n buildAgent.setName(agentName);\n }\n}\n","subject":"Change build agent name only if it differs"} {"old_contents":"package ee.ellytr.autoclick.tps;\n\nimport ee.ellytr.autoclick.EllyCheat;\nimport org.bukkit.Bukkit;\nimport org.bukkit.ChatColor;\nimport org.bukkit.entity.Player;\n\npublic class TPSRunnable implements Runnable {\n\n @Override\n public void run() {\n for (Player player : Bukkit.getOnlinePlayers()) {\n double tps = Math.round(TPSTracker.getTPS() * 100.0) \/ 100.0;\n if (tps <= EllyCheat.getInstance().getConfig().getInt(\"tps-warning\")) {\n for (Player player2 : Bukkit.getOnlinePlayers()) {\n if (player2.hasPermission(\"ellycheat.cps.warning\")) {\n player2.sendMessage(ChatColor.GRAY + \"[\" + ChatColor.RED + \"!\" + ChatColor.GRAY + \"] The server is currently running at \" + ChatColor.GOLD + tps + ChatColor.GRAY + \" TPS!\");\n }\n }\n if (EllyCheat.getInstance().getConfig().getBoolean(\"log-warnings\")) {\n Bukkit.getConsoleSender().sendMessage(ChatColor.GRAY + \"[\" + ChatColor.RED + \"!\" + ChatColor.GRAY + \"] The server is currently running at \" + ChatColor.GOLD + tps + ChatColor.GRAY + \" TPS!\");\n }\n }\n }\n Bukkit.getScheduler().runTaskLaterAsynchronously(EllyCheat.getInstance(), this, 20);\n }\n}\n","new_contents":"package ee.ellytr.autoclick.tps;\n\nimport ee.ellytr.autoclick.EllyCheat;\nimport org.bukkit.Bukkit;\nimport org.bukkit.ChatColor;\nimport org.bukkit.entity.Player;\n\npublic class TPSRunnable implements Runnable {\n\n @Override\n public void run() {\n for (Player player : Bukkit.getOnlinePlayers()) {\n double tps = Math.round(TPSTracker.getTPS() * 100.0) \/ 100.0;\n if (tps <= EllyCheat.getInstance().getConfig().getInt(\"tps-warning\")) {\n if (player.hasPermission(\"ellycheat.cps.warning\")) {\n player.sendMessage(ChatColor.GRAY + \"[\" + ChatColor.RED + \"!\" + ChatColor.GRAY + \"] The server is currently running at \" + ChatColor.GOLD + tps + ChatColor.GRAY + \" TPS!\");\n }\n if (EllyCheat.getInstance().getConfig().getBoolean(\"log-warnings\")) {\n Bukkit.getConsoleSender().sendMessage(ChatColor.GRAY + \"[\" + ChatColor.RED + \"!\" + ChatColor.GRAY + \"] The server is currently running at \" + ChatColor.GOLD + tps + ChatColor.GRAY + \" TPS!\");\n }\n }\n }\n Bukkit.getScheduler().runTaskLaterAsynchronously(EllyCheat.getInstance(), this, 20);\n }\n}\n","subject":"Fix TPS warning messages being sent too many times"} {"old_contents":"package de.rheinfabrik.heimdalldroid.network.oauth2;\n\nimport de.rheinfabrik.heimdall2.OAuth2AccessToken;\nimport de.rheinfabrik.heimdall2.grants.OAuth2RefreshAccessTokenGrant;\nimport de.rheinfabrik.heimdalldroid.network.TraktTvApiFactory;\nimport de.rheinfabrik.heimdalldroid.network.models.RefreshTokenRequestBody;\nimport io.reactivex.Single;\n\n\/**\n * TraktTv refresh token grant as described in http:\/\/docs.trakt.apiary.io\/#reference\/authentication-oauth\/token\/exchange-refresh_token-for-access_token.\n *\/\npublic class TraktTvRefreshAccessTokenGrant extends OAuth2RefreshAccessTokenGrant {\n\n \/\/ Properties\n\n public String clientSecret;\n public String clientId;\n public String redirectUri;\n\n \/\/ OAuth2RefreshAccessTokenGrant\n\n @Override\n public Single grantNewAccessToken() {\n RefreshTokenRequestBody body = new RefreshTokenRequestBody(refreshToken, clientId, clientSecret, redirectUri, GRANT_TYPE);\n return TraktTvApiFactory.newApiService().refreshAccessToken(body).singleOrError();\n }\n}\n","new_contents":"package de.rheinfabrik.heimdalldroid.network.oauth2;\n\nimport de.rheinfabrik.heimdall2.OAuth2AccessToken;\nimport de.rheinfabrik.heimdall2.grants.OAuth2RefreshAccessTokenGrant;\nimport de.rheinfabrik.heimdalldroid.network.TraktTvApiFactory;\nimport de.rheinfabrik.heimdalldroid.network.models.RefreshTokenRequestBody;\nimport io.reactivex.Single;\n\n\/**\n * TraktTv refresh token grant as described in http:\/\/docs.trakt.apiary.io\/#reference\/authentication-oauth\/token\/exchange-refresh_token-for-access_token.\n *\/\npublic class TraktTvRefreshAccessTokenGrant extends OAuth2RefreshAccessTokenGrant {\n\n \/\/ Properties\n\n public String clientSecret;\n public String clientId;\n public String redirectUri;\n\n \/\/ OAuth2RefreshAccessTokenGrant\n\n @Override\n public Single grantNewAccessToken() {\n RefreshTokenRequestBody body = new RefreshTokenRequestBody(getRefreshToken(), clientId, clientSecret, redirectUri, getGRANT_TYPE());\n return TraktTvApiFactory.newApiService().refreshAccessToken(body).singleOrError();\n }\n}\n","subject":"Migrate usage of the TokenGrant in the sample"} {"old_contents":"package org.xcolab.client.admin.enums;\n\npublic enum ServerEnvironment {\n PRODUCTION, STAGING, DEV, LOCAL, UNKNOWN;\n\n public boolean isProduction() {\n return PRODUCTION == this;\n }\n}\n","new_contents":"package org.xcolab.client.admin.enums;\n\npublic enum ServerEnvironment {\n PRODUCTION, STAGING, DEV, LOCAL, UNKNOWN;\n\n public boolean getIsProduction() {\n return PRODUCTION == this;\n }\n}\n","subject":"Fix method name to work with jsp"} {"old_contents":"package com.github.havarunner.scenarios.duplicated;\n\nimport com.github.havarunner.annotation.AfterAll;\nimport org.junit.Test;\n\nimport java.util.List;\nimport java.util.concurrent.atomic.AtomicInteger;\n\nimport static org.junit.Assert.assertTrue;\n\nabstract class VerifyThatTestAreRunOnlyOnceTestSuperClass {\n protected final AtomicInteger suiteObject;\n protected final List scenarios;\n VerifyThatTestAreRunOnlyOnceTestSuperClass(AtomicInteger suiteObject, List scenarios) {\n this.suiteObject = suiteObject;\n this.scenarios = scenarios;\n }\n @Test\n public void verifyTestIsRanOnlyOncePerScenario() {\n final int runNumber = suiteObject.addAndGet(1);\n System.out.println(\"Run: \"+runNumber+ \" for scenario: \"+scenarios);\n synchronized (VerifyThatTestAreRunOnlyOnceTestOneImpl.class) {\n assertTrue(runNumber+\" \/ \"+VerifyThatTestAreRunOnlyOnceTestOneImpl.scenarios().size()+ \" currentScenario: \"+scenarios, VerifyThatTestAreRunOnlyOnceTestOneImpl.scenarios().size() >= runNumber);\n }\n }\n\n @AfterAll\n public void afterAll() {\n\n }\n\n\n}\n","new_contents":"package com.github.havarunner.scenarios.duplicated;\n\nimport org.junit.Test;\n\nimport java.util.List;\nimport java.util.concurrent.atomic.AtomicInteger;\n\nimport static org.junit.Assert.assertTrue;\n\nabstract class VerifyThatTestAreRunOnlyOnceTestSuperClass {\n protected final AtomicInteger suiteObject;\n protected final List scenarios;\n VerifyThatTestAreRunOnlyOnceTestSuperClass(AtomicInteger suiteObject, List scenarios) {\n this.suiteObject = suiteObject;\n this.scenarios = scenarios;\n }\n @Test\n public void verifyTestIsRanOnlyOncePerScenario() {\n final int runNumber = suiteObject.addAndGet(1);\n System.out.println(\"Run: \"+runNumber+ \" for scenario: \"+scenarios);\n synchronized (VerifyThatTestAreRunOnlyOnceTestOneImpl.class) {\n assertTrue(runNumber+\" \/ \"+VerifyThatTestAreRunOnlyOnceTestOneImpl.scenarios().size()+ \" currentScenario: \"+scenarios, VerifyThatTestAreRunOnlyOnceTestOneImpl.scenarios().size() >= runNumber);\n }\n }\n}\n","subject":"Remove @AfterAll, did not cause problem after all"} {"old_contents":"package com.stubbornjava.examples.undertow.routing;\n\nimport io.undertow.server.HttpHandler;\nimport io.undertow.server.HttpServerExchange;\nimport io.undertow.util.Headers;\n\n\/\/ {{start:handler}}\npublic class ConstantStringHandler implements HttpHandler {\n private final String value;\n public ConstantStringHandler(String value) {\n this.value = value;\n }\n\n @Override\n public void handleRequest(HttpServerExchange exchange) throws Exception {\n exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, \"text\/plain\");\n exchange.getResponseSender().send(value);\n }\n}\n\/\/ {{end:handler}}","new_contents":"package com.stubbornjava.examples.undertow.routing;\n\nimport io.undertow.server.HttpHandler;\nimport io.undertow.server.HttpServerExchange;\nimport io.undertow.util.Headers;\n\n\/\/ {{start:handler}}\npublic class ConstantStringHandler implements HttpHandler {\n private final String value;\n public ConstantStringHandler(String value) {\n this.value = value;\n }\n\n @Override\n public void handleRequest(HttpServerExchange exchange) throws Exception {\n exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, \"text\/plain\");\n exchange.getResponseSender().send(value + \"\\n\");\n }\n}\n\/\/ {{end:handler}}\n","subject":"Add newline at the end of constant string handler"} {"old_contents":"\/*******************************************************************************\n * Copyright (c) 2015-2016 Oak Ridge National Laboratory.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *******************************************************************************\/\npackage org.csstudio.display.builder.model.properties;\n\n\/** Information about an action that writes a PV\n *\n * @author Kay Kasemir\n *\/\n@SuppressWarnings(\"nls\")\npublic class WritePVActionInfo extends ActionInfo\n{\n private final String pv;\n private final String value;\n\n \/** @param description Action description\n * @param pv PV name\n * @param value Value to write\n *\/\n public WritePVActionInfo(final String description, final String pv, final String value)\n {\n super(description);\n this.pv = pv;\n this.value = value;\n }\n\n @Override\n public ActionType getType()\n {\n return ActionType.WRITE_PV;\n }\n\n \/** @return PV name *\/\n public String getPV()\n {\n return pv;\n }\n\n \/** @return Value to write *\/\n public String getValue()\n {\n return value;\n }\n\n @Override\n public String toString()\n {\n if (getDescription().isEmpty())\n return \"Write \" + pv + \" = \" + value;\n else\n return getDescription();\n }\n}\n","new_contents":"\/*******************************************************************************\n * Copyright (c) 2015-2016 Oak Ridge National Laboratory.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *******************************************************************************\/\npackage org.csstudio.display.builder.model.properties;\n\n\/** Information about an action that writes a PV\n *\n * @author Kay Kasemir\n *\/\n@SuppressWarnings(\"nls\")\npublic class WritePVActionInfo extends ActionInfo\n{\n private final String pv;\n private final String value;\n\n \/** @param description Action description\n * @param pv PV name\n * @param value Value to write\n *\/\n public WritePVActionInfo(final String description, final String pv, final String value)\n {\n super(description);\n this.pv = pv;\n this.value = value;\n }\n\n @Override\n public ActionType getType()\n {\n return ActionType.WRITE_PV;\n }\n\n \/** @return PV name *\/\n public String getPV()\n {\n return pv;\n }\n\n \/** @return Value to write *\/\n public String getValue()\n {\n return value;\n }\n\n @Override\n public String toString()\n {\n if (getDescription().isEmpty())\n return \"Write \" + value + \" to \" + pv;\n else\n return getDescription();\n }\n}\n","subject":"Use same string representation as BOY"} {"old_contents":"package org.pentaho.ui.xul.swt.tags;\n\nimport org.eclipse.swt.SWT;\nimport org.eclipse.swt.widgets.Composite;\nimport org.eclipse.swt.widgets.ToolBar;\nimport org.pentaho.ui.xul.XulComponent;\nimport org.pentaho.ui.xul.XulDomContainer;\nimport org.pentaho.ui.xul.containers.XulToolbar;\nimport org.pentaho.ui.xul.dom.Element;\nimport org.pentaho.ui.xul.swt.AbstractSwtXulContainer;\n\npublic class SwtToolbar extends AbstractSwtXulContainer implements XulToolbar{\n\n ToolBar toolbar;\n public SwtToolbar(Element self, XulComponent parent, XulDomContainer domContainer, String tagName) {\n super(\"toolbar\");\n \n toolbar = new ToolBar((Composite) parent.getManagedObject(), SWT.HORIZONTAL);\n setManagedObject(toolbar);\n }\n\n public ToolbarMode getMode() {\n \/\/ TODO Auto-generated method stub\n return null;\n }\n\n public String getToolbarName() {\n \/\/ TODO Auto-generated method stub\n return null;\n }\n\n public void setMode(ToolbarMode mode) {\n \/\/ TODO Auto-generated method stub\n \n }\n\n public void setToolbarName(String name) {\n \/\/ TODO Auto-generated method stub\n \n }\n \n \n}\n","new_contents":"package org.pentaho.ui.xul.swt.tags;\n\nimport org.eclipse.swt.SWT;\nimport org.eclipse.swt.widgets.Composite;\nimport org.eclipse.swt.widgets.Shell;\nimport org.eclipse.swt.widgets.ToolBar;\nimport org.pentaho.ui.xul.XulComponent;\nimport org.pentaho.ui.xul.XulDomContainer;\nimport org.pentaho.ui.xul.containers.XulToolbar;\nimport org.pentaho.ui.xul.dom.Element;\nimport org.pentaho.ui.xul.swt.AbstractSwtXulContainer;\n\npublic class SwtToolbar extends AbstractSwtXulContainer implements XulToolbar{\n\n ToolBar toolbar;\n public SwtToolbar(Element self, XulComponent parent, XulDomContainer domContainer, String tagName) {\n super(\"toolbar\");\n \n String attr = self.getAttributeValue(\"parenttoouter\");\n Object shell = (attr != null && attr.equals(\"true\") && domContainer.getOuterContext() != null) \n ? domContainer.getOuterContext() \n : null; \n if(shell != null && shell instanceof Shell){\n toolbar = new ToolBar((Shell) shell, SWT.HORIZONTAL);\n } else if(shell != null && shell instanceof Composite){\n toolbar = new ToolBar((Composite) shell, SWT.HORIZONTAL);\n } else {\n toolbar = new ToolBar((Composite) parent.getManagedObject(), SWT.HORIZONTAL);\n }\n setManagedObject(toolbar);\n }\n\n public ToolbarMode getMode() {\n \/\/ TODO Auto-generated method stub\n return null;\n }\n\n public String getToolbarName() {\n \/\/ TODO Auto-generated method stub\n return null;\n }\n\n public void setMode(ToolbarMode mode) {\n \/\/ TODO Auto-generated method stub\n \n }\n\n public void setToolbarName(String name) {\n \/\/ TODO Auto-generated method stub\n \n }\n \n \n}\n","subject":"Support for parenting toolbar to outercontext"} {"old_contents":"\/*\n * This file is part of the DITA Open Toolkit project.\n * See the accompanying license.txt file for applicable licenses.\n *\/\n\n\/*\n * (c) Copyright IBM Corp. 2008 All Rights Reserved.\n *\/\npackage org.dita.dost.platform;\n\nimport org.dita.dost.util.StringUtils;\n\/**\n * CheckTranstypeAction class.\n *\n *\/\nfinal class CheckTranstypeAction extends ImportAction {\n\n \/**\n * Get result.\n * @return result\n *\/\n @Override\n public String getResult() {\n final StringBuilder retBuf = new StringBuilder();\n final String property = paramTable.get(\"property\");\n for (final String value: valueSet) {\n retBuf.append(\"<\/not>\");\n }\n return retBuf.toString();\n }\n\n}\n","new_contents":"\/*\n * This file is part of the DITA Open Toolkit project.\n * See the accompanying license.txt file for applicable licenses.\n *\/\n\n\/*\n * (c) Copyright IBM Corp. 2008 All Rights Reserved.\n *\/\npackage org.dita.dost.platform;\n\nimport org.dita.dost.util.StringUtils;\n\/**\n * CheckTranstypeAction class.\n *\n *\/\nfinal class CheckTranstypeAction extends ImportAction {\n\n \/**\n * Get result.\n * @return result\n *\/\n @Override\n public String getResult() {\n final StringBuilder retBuf = new StringBuilder();\n final String property = paramTable.containsKey(\"property\") ? paramTable.get(\"property\") : \"transtype\";\n for (final String value: valueSet) {\n retBuf.append(\"<\/not>\");\n }\n return retBuf.toString();\n }\n\n}\n","subject":"Add default check type in integration"} {"old_contents":"package org.springframework.cloud.servicebroker.model;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.annotation.JsonSerialize;\nimport lombok.EqualsAndHashCode;\nimport lombok.Getter;\nimport lombok.ToString;\nimport org.apache.commons.beanutils.BeanUtils;\n\nimport java.util.Map;\n\n\/**\n * Details of a request that supports arbitrary parameters and asynchronous behavior.\n *\n * @author Scott Frederick\n *\/\n@Getter\n@ToString(callSuper = true)\n@EqualsAndHashCode(callSuper = true)\npublic abstract class AsyncParameterizedServiceInstanceRequest extends AsyncServiceInstanceRequest {\n\t\/**\n\t * Parameters passed by the user in the form of a JSON structure. The service broker is responsible\n\t * for validating the contents of the parameters for correctness or applicability.\n\t *\/\n\t@JsonSerialize\n\t@JsonProperty(\"parameters\")\n\tprotected final Map parameters;\n\n\tpublic AsyncParameterizedServiceInstanceRequest(Map parameters) {\n\t\tthis.parameters = parameters;\n\t}\n\n\tpublic T getParameters(Class cls) {\n\t\ttry {\n\t\t\tT bean = cls.newInstance();\n\t\t\tBeanUtils.populate(bean, parameters);\n\t\t\treturn bean;\n\t\t} catch (Exception e) {\n\t\t\tthrow new IllegalArgumentException(\"Error mapping parameters to class of type \" + cls.getName());\n\t\t}\n\t}\n}\n","new_contents":"package org.springframework.cloud.servicebroker.model;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.annotation.JsonSerialize;\nimport lombok.EqualsAndHashCode;\nimport lombok.Getter;\nimport lombok.ToString;\nimport org.apache.commons.beanutils.BeanUtils;\n\nimport java.util.Map;\n\n\/**\n * Details of a request that supports arbitrary parameters and asynchronous behavior.\n *\n * @author Scott Frederick\n *\/\n@Getter\n@ToString(callSuper = true)\n@EqualsAndHashCode(callSuper = true)\npublic abstract class AsyncParameterizedServiceInstanceRequest extends AsyncServiceInstanceRequest {\n\t\/**\n\t * Parameters passed by the user in the form of a JSON structure. The service broker is responsible\n\t * for validating the contents of the parameters for correctness or applicability.\n\t *\/\n\t@JsonSerialize\n\t@JsonProperty(\"parameters\")\n\tprotected final Map parameters;\n\n\tpublic AsyncParameterizedServiceInstanceRequest(Map parameters) {\n\t\tthis.parameters = parameters;\n\t}\n\n\tpublic T getParameters(Class cls) {\n\t\ttry {\n\t\t\tT bean = cls.newInstance();\n\t\t\tBeanUtils.populate(bean, parameters);\n\t\t\treturn bean;\n\t\t} catch (Exception e) {\n\t\t\tthrow new IllegalArgumentException(\"Error mapping parameters to class of type \" + cls.getName(), e);\n\t\t}\n\t}\n}\n","subject":"Add the cause when mapping parameters fails"} {"old_contents":"package com.atlassian.sal.refimpl;\n\nimport com.atlassian.sal.api.ApplicationProperties;\n\nimport java.util.Date;\nimport java.io.File;\n\n\/**\n * Implementation of ApplicationProperties for http:\/\/localhost\n *\/\npublic class RefimplApplicationProperties implements ApplicationProperties\n{\n private static final Date THEN = new Date();\n\n public String getBaseUrl()\n {\n return System.getProperty(\"baseurl\", \"http:\/\/localhost:8080\/atlassian-plugins-refimpl\");\n }\n\n public String getDisplayName()\n {\n return \"RefImpl\";\n }\n\n public String getVersion()\n {\n return \"1.0\";\n }\n\n public Date getBuildDate()\n {\n return THEN;\n }\n\n public String getBuildNumber()\n {\n return \"123\";\n }\n\n public File getHomeDirectory()\n {\n return new File(System.getProperty(\"java.tmp.dir\"));\n }\n}\n","new_contents":"package com.atlassian.sal.refimpl;\n\nimport com.atlassian.sal.api.ApplicationProperties;\n\nimport java.util.Date;\nimport java.io.File;\n\n\/**\n * Implementation of ApplicationProperties for http:\/\/localhost\n *\/\npublic class RefimplApplicationProperties implements ApplicationProperties\n{\n private static final Date THEN = new Date();\n\n public String getBaseUrl()\n {\n return System.getProperty(\"baseurl\", \"http:\/\/localhost:8080\/atlassian-plugins-refimpl\");\n }\n\n public String getDisplayName()\n {\n return \"RefImpl\";\n }\n\n public String getVersion()\n {\n return \"1.0\";\n }\n\n public Date getBuildDate()\n {\n return THEN;\n }\n\n public String getBuildNumber()\n {\n return \"123\";\n }\n\n public File getHomeDirectory()\n {\n return new File(System.getProperty(\"java.io.tmpdir\"));\n }\n}\n","subject":"Fix wrong java tmp dir sys property"} {"old_contents":"package arez;\n\nimport javax.annotation.Nonnull;\nimport jsinterop.annotations.JsFunction;\n\n\/**\n * Interface that accepts an {@link Observer} that has been scheduled and\n * performs the actions required to run observer.\n *\n *

      The interface is marked with the {@link JsFunction} annotation to communicate\n * to the GWT2 compiler that it is not necessary to generate class information\n * for the implementing methods which reduces code size somewhat.<\/p>\n *\/\n@JsFunction\n@FunctionalInterface\ninterface Reaction\n{\n \/**\n * React to changes, or throw an exception if unable to do so.\n *\n * @param observer the observer of changes.\n * @throws Throwable if there is an error reacting to changes.\n *\/\n void react( @Nonnull Observer observer )\n throws Throwable;\n}\n","new_contents":"package arez;\n\nimport javax.annotation.Nonnull;\n\n\/**\n * Interface that accepts an {@link Observer} that has been scheduled and\n * performs the actions required to run observer.\n *\/\n@FunctionalInterface\ninterface Reaction\n{\n \/**\n * React to changes, or throw an exception if unable to do so.\n *\n * @param observer the observer of changes.\n * @throws Throwable if there is an error reacting to changes.\n *\/\n void react( @Nonnull Observer observer )\n throws Throwable;\n}\n","subject":"Remove JsFunction as in some cases it increases the code size"} {"old_contents":"package com.Acrobot.Breeze.Configuration;\n\nimport com.Acrobot.Breeze.Configuration.Annotations.ConfigurationComment;\n\nimport java.lang.reflect.Field;\n\n\/**\n * @author Acrobot\n *\/\npublic class FieldParser {\n \/**\n * Parses a field into a YAML-compatible string\n *\n * @param field Field to parse\n * @return Parsed field\n *\/\n public static String parse(Field field) {\n StringBuilder builder = new StringBuilder(50);\n\n try {\n builder.append(field.getName()).append(\": \").append(ValueParser.parseToYAML(field.get(null)));\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n return \"\";\n }\n\n if (field.isAnnotationPresent(ConfigurationComment.class)) {\n builder.append('\\n').append('#').append(field.getAnnotation(ConfigurationComment.class).value());\n }\n\n return builder.toString();\n }\n}\n","new_contents":"package com.Acrobot.Breeze.Configuration;\n\nimport com.Acrobot.Breeze.Configuration.Annotations.ConfigurationComment;\n\nimport java.lang.reflect.Field;\n\n\/**\n * @author Acrobot\n *\/\npublic class FieldParser {\n \/**\n * Parses a field into a YAML-compatible string\n *\n * @param field Field to parse\n * @return Parsed field\n *\/\n public static String parse(Field field) {\n StringBuilder builder = new StringBuilder(50);\n \n if (field.isAnnotationPresent(ConfigurationComment.class)) {\n builder.append('#').append(field.getAnnotation(ConfigurationComment.class).value()).append('\\n');\n }\n \n try {\n builder.append(field.getName()).append(\": \").append(ValueParser.parseToYAML(field.get(null)));\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n return \"\";\n }\n\n return builder.toString();\n }\n}\n","subject":"Move comments in above config fields. This should help avoid confusions as it matches the class' annotation layout and almost every other plugin does it like this."} {"old_contents":"package com.codenvy.ide.ext.datasource.client.sqllauncher;\n\nimport com.google.gwt.i18n.client.LocalizableResource.DefaultLocale;\nimport com.google.gwt.i18n.client.Messages;\n\n@DefaultLocale(\"en\")\npublic interface SqlRequestLauncherConstants extends Messages {\n\n @DefaultMessage(\"Open SQL editor\")\n String menuEntryOpenSqlEditor();\n\n @DefaultMessage(\"SQL editor\")\n String sqlEditorWindowTitle();\n\n @DefaultMessage(\"Select datasource\")\n String selectDatasourceLabel();\n\n @DefaultMessage(\"Result limit\")\n String resultLimitLabel();\n\n @DefaultMessage(\"Execute\")\n String executeButtonLabel();\n\n @DefaultMessage(\"{0} rows.\")\n @AlternateMessage({\"one\", \"{0} row.\"})\n String updateCountMessage(@PluralCount int count);\n\n @DefaultMessage(\"Export as CSV file\")\n String exportCsvLabel();\n}\n","new_contents":"package com.codenvy.ide.ext.datasource.client.sqllauncher;\n\nimport com.google.gwt.i18n.client.LocalizableResource.DefaultLocale;\nimport com.google.gwt.i18n.client.Messages;\n\n@DefaultLocale(\"en\")\npublic interface SqlRequestLauncherConstants extends Messages {\n\n @DefaultMessage(\"Open SQL editor\")\n String menuEntryOpenSqlEditor();\n\n @DefaultMessage(\"SQL editor\")\n String sqlEditorWindowTitle();\n\n @DefaultMessage(\"Select datasource\")\n String selectDatasourceLabel();\n\n @DefaultMessage(\"Result limit\")\n String resultLimitLabel();\n\n @DefaultMessage(\"Execute\")\n String executeButtonLabel();\n\n @DefaultMessage(\"{0} rows.\")\n @AlternateMessage({\"one\", \"{0} row.\"})\n String updateCountMessage(@PluralCount int count);\n\n @DefaultMessage(\"Export as CSV file\")\n String exportCsvLabel();\n\n @DefaultMessage(\"Execution mode\")\n String executionModeLabel();\n\n @DefaultMessage(\"Execute all - ignore and report errors\")\n String executeAllModeItem();\n\n @DefaultMessage(\"First error - stop on first error\")\n String stopOnErrorModeitem();\n\n @DefaultMessage(\"Transaction - rollback on first error\")\n String transactionModeItem();\n}\n","subject":"Add string for execution mode"} {"old_contents":"package com.braintreepayments.demo;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.view.MenuItem;\n\nimport com.braintreepayments.demo.fragments.SettingsFragment;\n\npublic class SettingsActivity extends Activity {\n\n @SuppressWarnings(\"ConstantConditions\")\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n getActionBar().setDisplayHomeAsUpEnabled(true);\n\n getFragmentManager().beginTransaction()\n .replace(android.R.id.content, new SettingsFragment())\n .commit();\n }\n\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n finish();\n return true;\n }\n return false;\n }\n}\n","new_contents":"package com.braintreepayments.demo;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.view.MenuItem;\n\nimport com.braintreepayments.demo.fragments.SettingsFragment;\n\npublic class SettingsActivity extends AppCompatActivity {\n\n @SuppressWarnings(\"ConstantConditions\")\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n\n getFragmentManager().beginTransaction()\n .replace(android.R.id.content, new SettingsFragment())\n .commit();\n }\n\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n finish();\n return true;\n }\n return false;\n }\n}\n","subject":"Fix crash in demo app settings"} {"old_contents":"package org.appcelerator.titanium;\r\n\r\nimport java.lang.annotation.ElementType;\r\nimport java.lang.annotation.Retention;\r\nimport java.lang.annotation.RetentionPolicy;\r\nimport java.lang.annotation.Target;\r\n\r\n@Target(ElementType.TYPE)\r\n@Retention(RetentionPolicy.RUNTIME)\r\npublic @interface ContextSpecific {\r\n\r\n}\r\n","new_contents":"package org.appcelerator.titanium;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n@Target(ElementType.TYPE)\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface ContextSpecific {\n\n}\n","subject":"Remove crlf - oops, changed settings on my Win7 dev machine"} {"old_contents":"\/\/ Copyright (c) 1999 Brian Wellington (bwelling@xbill.org)\n\/\/ Portions Copyright (c) 1999 Network Associates, Inc.\n\npackage org.xbill.DNS;\n\nimport java.util.*;\nimport java.io.*;\nimport java.net.*;\n\n\/**\n * A special-purpose thread used by Resolvers (both SimpleResolver and\n * ExtendedResolver) to perform asynchronous queries.\n *\n * @author Brian Wellington\n *\/\n\nclass ResolveThread implements Runnable {\n\nprivate Message query;\nprivate Object id;\nprivate ResolverListener listener;\nprivate Resolver res;\n\n\/** Creates a new ResolveThread *\/\npublic\nResolveThread(Resolver res, Message query, Object id,\n\t ResolverListener listener)\n{\n\tthis.res = res;\n\tthis.query = query;\n\tthis.id = id;\n\tthis.listener = listener;\n}\n\n\n\/**\n * Performs the query, and executes the callback.\n *\/\npublic void\nrun() {\n\ttry {\n\t\tMessage response = res.send(query);\n\t\tlistener.receiveMessage(id, response);\n\t}\n\tcatch (Exception e) {\n\t\tlistener.handleException(id, e);\n\t}\n}\n\n}\n","new_contents":"\/\/ Copyright (c) 1999 Brian Wellington (bwelling@xbill.org)\n\/\/ Portions Copyright (c) 1999 Network Associates, Inc.\n\npackage org.xbill.DNS;\n\nimport java.util.*;\nimport java.io.*;\nimport java.net.*;\n\n\/**\n * A special-purpose thread used by Resolvers (both SimpleResolver and\n * ExtendedResolver) to perform asynchronous queries.\n *\n * @author Brian Wellington\n *\/\n\nclass ResolveThread extends Thread {\n\nprivate Message query;\nprivate Object id;\nprivate ResolverListener listener;\nprivate Resolver res;\n\n\/** Creates a new ResolveThread *\/\npublic\nResolveThread(Resolver res, Message query, Object id,\n\t ResolverListener listener)\n{\n\tthis.res = res;\n\tthis.query = query;\n\tthis.id = id;\n\tthis.listener = listener;\n}\n\n\n\/**\n * Performs the query, and executes the callback.\n *\/\npublic void\nrun() {\n\ttry {\n\t\tMessage response = res.send(query);\n\t\tlistener.receiveMessage(id, response);\n\t}\n\tcatch (Exception e) {\n\t\tlistener.handleException(id, e);\n\t}\n}\n\n}\n","subject":"Make this a subclass of Thread."} {"old_contents":"package io.smartlogic.smartchat;\n\nimport android.app.IntentService;\nimport android.app.NotificationManager;\nimport android.app.PendingIntent;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.support.v4.app.NotificationCompat;\nimport android.support.v4.app.TaskStackBuilder;\n\nimport io.smartlogic.smartchat.activities.DisplaySmartChatActivity;\nimport io.smartlogic.smartchat.activities.MainActivity;\n\npublic class GcmIntentService extends IntentService {\n public GcmIntentService() {\n super(\"GcmIntentService\");\n }\n\n @Override\n protected void onHandleIntent(Intent intent) {\n Bundle extras = intent.getExtras();\n\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)\n .setAutoCancel(true)\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentTitle(\"New SmartChat\")\n .setContentText(\"SmartChat from \" + extras.getString(\"creator_email\"));\n Intent resultIntent = new Intent(this, DisplaySmartChatActivity.class);\n resultIntent.putExtras(extras);\n\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(MainActivity.class);\n stackBuilder.addNextIntent(resultIntent);\n PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n mBuilder.setContentIntent(resultPendingIntent);\n\n NotificationManager mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);\n mNotificationManager.notify(1, mBuilder.build());\n }\n}\n","new_contents":"package io.smartlogic.smartchat;\n\nimport android.app.IntentService;\nimport android.app.NotificationManager;\nimport android.app.PendingIntent;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.support.v4.app.NotificationCompat;\nimport android.support.v4.app.TaskStackBuilder;\n\nimport io.smartlogic.smartchat.activities.DisplaySmartChatActivity;\nimport io.smartlogic.smartchat.activities.MainActivity;\n\npublic class GcmIntentService extends IntentService {\n public GcmIntentService() {\n super(\"GcmIntentService\");\n }\n\n @Override\n protected void onHandleIntent(Intent intent) {\n Bundle extras = intent.getExtras();\n\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)\n .setAutoCancel(true)\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentTitle(\"New SmartChat\")\n .setContentText(\"SmartChat from \" + extras.getString(\"creator_email\"));\n Intent resultIntent = new Intent(this, DisplaySmartChatActivity.class);\n resultIntent.putExtras(extras);\n\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(MainActivity.class);\n stackBuilder.addNextIntent(resultIntent);\n PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n mBuilder.setContentIntent(resultPendingIntent);\n\n NotificationManager mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);\n mNotificationManager.notify(extras.getInt(\"id\", 1), mBuilder.build());\n }\n}\n","subject":"Use the media id as notification id"} {"old_contents":"\/*\n * JBoss, Home of Professional Open Source\n * Copyright 2013, Red Hat, Inc. and\/or its affiliates, and individual\n * contributors by the @authors tag. See the copyright.txt in the\n * distribution for a full listing of individual contributors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.jboss.as.quickstarts.deltaspike.exceptionhandling.util;\n\nimport java.util.logging.Logger;\n\nimport javax.enterprise.inject.Produces;\nimport javax.enterprise.inject.spi.InjectionPoint;\nimport javax.faces.context.FacesContext;\n\n\/**\n * CDI Resource aliases\n * \n * @author Rafael Benevides<\/a>\n * \n *\/\npublic class Resources {\n\n @Produces\n public Logger produceLog(InjectionPoint injectionPoint) {\n return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());\n }\n\n @Produces\n @RequestScoped\n public FacesContext produceFacesContext() {\n return FacesContext.getCurrentInstance();\n }\n}\n","new_contents":"\/*\n * JBoss, Home of Professional Open Source\n * Copyright 2013, Red Hat, Inc. and\/or its affiliates, and individual\n * contributors by the @authors tag. See the copyright.txt in the\n * distribution for a full listing of individual contributors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.jboss.as.quickstarts.deltaspike.exceptionhandling.util;\n\nimport java.util.logging.Logger;\n\nimport javax.enterprise.context.RequestScoped;\nimport javax.enterprise.inject.Produces;\nimport javax.enterprise.inject.spi.InjectionPoint;\nimport javax.faces.context.FacesContext;\n\n\/**\n * CDI Resource aliases\n * \n * @author Rafael Benevides<\/a>\n * \n *\/\npublic class Resources {\n\n @Produces\n public Logger produceLog(InjectionPoint injectionPoint) {\n return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());\n }\n\n @Produces\n @RequestScoped\n public FacesContext produceFacesContext() {\n return FacesContext.getCurrentInstance();\n }\n}\n","subject":"Fix compilation error in deltaspike quickstart"} {"old_contents":"package ch.rasc.eds.starter.schedule;\n\nimport java.time.ZoneOffset;\nimport java.time.ZonedDateTime;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.scheduling.annotation.Scheduled;\nimport org.springframework.stereotype.Component;\n\nimport com.mongodb.client.model.Filters;\nimport com.mongodb.client.model.Updates;\n\nimport ch.rasc.eds.starter.config.MongoDb;\nimport ch.rasc.eds.starter.entity.CUser;\nimport ch.rasc.eds.starter.entity.User;\n\n@Component\npublic class DisableInactiveUser {\n\n\tprivate final MongoDb mongoDb;\n\n\t@Autowired\n\tpublic DisableInactiveUser(MongoDb mongoDb) {\n\t\tthis.mongoDb = mongoDb;\n\t}\n\n\t@Scheduled(cron = \"0 0 5 * * *\")\n\tpublic void doCleanup() {\n\t\t\/\/ Inactivate users that have a lastAccess timestamp that is older than one year\n\t\tZonedDateTime oneYearAgo = ZonedDateTime.now(ZoneOffset.UTC).minusYears(1);\n\t\tthis.mongoDb.getCollection(User.class).updateMany(\n\t\t\t\tFilters.lte(CUser.lastAccess, oneYearAgo),\n\t\t\t\tUpdates.set(CUser.enabled, false));\n\t}\n\n}\n","new_contents":"package ch.rasc.eds.starter.schedule;\n\nimport java.time.ZoneOffset;\nimport java.time.ZonedDateTime;\nimport java.util.Date;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.scheduling.annotation.Scheduled;\nimport org.springframework.stereotype.Component;\n\nimport com.mongodb.client.model.Filters;\nimport com.mongodb.client.model.Updates;\n\nimport ch.rasc.eds.starter.config.MongoDb;\nimport ch.rasc.eds.starter.entity.CUser;\nimport ch.rasc.eds.starter.entity.User;\n\n@Component\npublic class DisableInactiveUser {\n\n\tprivate final MongoDb mongoDb;\n\n\t@Autowired\n\tpublic DisableInactiveUser(MongoDb mongoDb) {\n\t\tthis.mongoDb = mongoDb;\n\t}\n\n\t@Scheduled(cron = \"0 0 5 * * *\")\n\tpublic void doCleanup() {\n\t\t\/\/ Inactivate users that have a lastAccess timestamp that is older than one year\n\t\tZonedDateTime oneYearAgo = ZonedDateTime.now(ZoneOffset.UTC).minusYears(1);\n\t\tthis.mongoDb.getCollection(User.class).updateMany(\n\t\t\t\tFilters.lte(CUser.lastAccess, Date.from(oneYearAgo.toInstant())),\n\t\t\t\tUpdates.set(CUser.enabled, false));\n\t}\n\n}\n","subject":"Fix query. Has to use java.util.Date"} {"old_contents":"\/*\n * This file is part of Bisq.\n *\n * Bisq is free software: you can redistribute it and\/or modify it\n * under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or (at\n * your option) any later version.\n *\n * Bisq is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public\n * License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Bisq. If not, see .\n *\/\n\npackage bisq.desktop.common.view;\n\nimport javax.inject.Inject;\nimport javax.inject.Singleton;\n\nimport java.util.HashMap;\n\n@Singleton\npublic class CachingViewLoader implements ViewLoader {\n\n private final HashMap cache = new HashMap<>();\n private final ViewLoader viewLoader;\n\n @Inject\n public CachingViewLoader(ViewLoader viewLoader) {\n this.viewLoader = viewLoader;\n }\n\n @Override\n public View load(Class viewClass) {\n if (cache.containsKey(viewClass))\n return cache.get(viewClass);\n\n View view = viewLoader.load(viewClass);\n cache.put(viewClass, view);\n return view;\n }\n}\n","new_contents":"\/*\n * This file is part of Bisq.\n *\n * Bisq is free software: you can redistribute it and\/or modify it\n * under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or (at\n * your option) any later version.\n *\n * Bisq is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public\n * License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Bisq. If not, see .\n *\/\n\npackage bisq.desktop.common.view;\n\nimport javax.inject.Inject;\nimport javax.inject.Singleton;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n@Singleton\npublic class CachingViewLoader implements ViewLoader {\n\n private final Map, View> cache = new HashMap<>();\n private final ViewLoader viewLoader;\n\n @Inject\n public CachingViewLoader(ViewLoader viewLoader) {\n this.viewLoader = viewLoader;\n }\n\n @Override\n public View load(Class viewClass) {\n if (cache.containsKey(viewClass))\n return cache.get(viewClass);\n\n View view = viewLoader.load(viewClass);\n cache.put(viewClass, view);\n return view;\n }\n}\n","subject":"Set correct type of cache map"} {"old_contents":"package org.commonmark.ext.heading.anchor.internal;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\nimport org.commonmark.html.AttributeProvider;\nimport org.commonmark.node.AbstractVisitor;\nimport org.commonmark.node.Code;\nimport org.commonmark.node.Heading;\nimport org.commonmark.node.Node;\nimport org.commonmark.node.Text;\n\nimport org.commonmark.ext.heading.anchor.UniqueIdentifierProvider;\n\npublic class HeadingIdAttributeProvider implements AttributeProvider {\n\n private final UniqueIdentifierProvider idProvider;\n\n private HeadingIdAttributeProvider() {\n idProvider = new UniqueIdentifierProvider(\"heading\");\n }\n\n public static HeadingIdAttributeProvider create() {\n return new HeadingIdAttributeProvider();\n }\n\n @Override\n public void setAttributes(Node node, final Map attributes) {\n\n if (node instanceof Heading) {\n\n final List wordList = new ArrayList<>();\n\n node.accept(new AbstractVisitor() {\n @Override\n public void visit(Text text) {\n wordList.add(text.getLiteral());\n }\n\n @Override\n public void visit(Code code) {\n wordList.add(code.getLiteral());\n }\n });\n\n attributes.put(\"id\", idProvider.getUniqueIdentifier(String.join(\"\", wordList)).toLowerCase());\n }\n }\n\n}\n","new_contents":"package org.commonmark.ext.heading.anchor.internal;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\nimport org.commonmark.html.AttributeProvider;\nimport org.commonmark.node.AbstractVisitor;\nimport org.commonmark.node.Code;\nimport org.commonmark.node.Heading;\nimport org.commonmark.node.Node;\nimport org.commonmark.node.Text;\n\nimport org.commonmark.ext.heading.anchor.UniqueIdentifierProvider;\n\npublic class HeadingIdAttributeProvider implements AttributeProvider {\n\n private final UniqueIdentifierProvider idProvider;\n\n private HeadingIdAttributeProvider() {\n idProvider = new UniqueIdentifierProvider(\"heading\");\n }\n\n public static HeadingIdAttributeProvider create() {\n return new HeadingIdAttributeProvider();\n }\n\n @Override\n public void setAttributes(Node node, final Map attributes) {\n\n if (node instanceof Heading) {\n\n final List wordList = new ArrayList<>();\n\n node.accept(new AbstractVisitor() {\n @Override\n public void visit(Text text) {\n wordList.add(text.getLiteral());\n }\n\n @Override\n public void visit(Code code) {\n wordList.add(code.getLiteral());\n }\n });\n\n String finalString = \"\";\n for (String word : wordList) {\n finalString += word + \" \";\n }\n finalString = finalString.trim().toLowerCase();\n\n attributes.put(\"id\", idProvider.getUniqueIdentifier(finalString));\n }\n }\n\n}\n","subject":"Remove Java 8 string join method"} {"old_contents":"package com.splicemachine.kafka;\n\nimport java.io.IOException;\nimport java.util.Properties;\nimport kafka.server.KafkaConfig;\nimport kafka.server.KafkaServerStartable;\nimport kafka.utils.TestUtils;\n\npublic class TestKafkaCluster {\n KafkaServerStartable kafkaServer;\n\n public TestKafkaCluster(String connectString) throws Exception {\n KafkaConfig config = getKafkaConfig(connectString);\n kafkaServer = new KafkaServerStartable(config);\n kafkaServer.startup();\n }\n\n public static void main(String [] args) throws Exception {\n TestKafkaCluster cluster;\n if (args.length==1)\n cluster = new TestKafkaCluster(args[0]);\n else\n throw new RuntimeException(\"No zookeper local\");\n }\n\n private static KafkaConfig getKafkaConfig(final String zkConnectString) {\n scala.collection.Iterator propsI =\n TestUtils.createBrokerConfigs(1,true).iterator();\n assert propsI.hasNext();\n Properties props = propsI.next();\n assert props.containsKey(\"zookeeper.connect\");\n props.put(\"zookeeper.connect\", zkConnectString);\n return new KafkaConfig(props);\n }\n\n public String getKafkaBrokerString() {\n return String.format(\"localhost:%d\",\n kafkaServer.serverConfig().port());\n }\n\n public int getKafkaPort() {\n return kafkaServer.serverConfig().port();\n }\n\n public void stop() throws IOException {\n kafkaServer.shutdown();\n }\n}\n","new_contents":"package com.splicemachine.kafka;\n\nimport java.io.IOException;\nimport java.util.Properties;\nimport kafka.server.KafkaConfig;\nimport kafka.server.KafkaServerStartable;\nimport kafka.utils.TestUtils;\n\npublic class TestKafkaCluster {\n KafkaServerStartable kafkaServer;\n\n public TestKafkaCluster(String connectString) throws Exception {\n KafkaConfig config = getKafkaConfig(connectString);\n kafkaServer = new KafkaServerStartable(config);\n kafkaServer.startup();\n }\n\n public static void main(String [] args) throws Exception {\n TestKafkaCluster cluster;\n if (args.length==1)\n cluster = new TestKafkaCluster(args[0]);\n else\n throw new RuntimeException(\"No zookeper local\");\n }\n\n private static KafkaConfig getKafkaConfig(final String zkConnectString) {\n scala.collection.Iterator propsI =\n TestUtils.createBrokerConfigs(1,true).iterator();\n assert propsI.hasNext();\n Properties props = propsI.next();\n assert props.containsKey(\"zookeeper.connect\");\n props.put(\"zookeeper.connect\", zkConnectString);\n props.put(\"port\",\"9092\");\n return new KafkaConfig(props);\n }\n\n public String getKafkaBrokerString() {\n return String.format(\"localhost:%d\",\n kafkaServer.serverConfig().port());\n }\n\n public int getKafkaPort() {\n return kafkaServer.serverConfig().port();\n }\n\n public void stop() throws IOException {\n kafkaServer.shutdown();\n }\n}\n","subject":"Fix the port to 9092"} {"old_contents":"package com.genymobile.scrcpy;\n\nimport junit.framework.Assert;\n\nimport org.junit.Test;\n\nimport java.nio.charset.StandardCharsets;\n\npublic class StringUtilsTest {\n\n @Test\n @SuppressWarnings(\"checkstyle:MagicNumber\")\n public void testUtf8Trucate() {\n String s = \"aÉbÔc\";\n byte[] utf8 = s.getBytes(StandardCharsets.UTF_8);\n Assert.assertEquals(7, utf8.length);\n\n int count;\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 1);\n Assert.assertEquals(1, count);\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 2);\n Assert.assertEquals(1, count); \/\/ É is 2 bytes-wide\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 3);\n Assert.assertEquals(3, count);\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 4);\n Assert.assertEquals(4, count);\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 5);\n Assert.assertEquals(4, count); \/\/ Ô is 2 bytes-wide\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 6);\n Assert.assertEquals(6, count);\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 7);\n Assert.assertEquals(7, count);\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 8);\n Assert.assertEquals(7, count); \/\/ no more chars\n }\n}\n","new_contents":"package com.genymobile.scrcpy;\n\nimport junit.framework.Assert;\n\nimport org.junit.Test;\n\nimport java.nio.charset.StandardCharsets;\n\npublic class StringUtilsTest {\n\n @Test\n @SuppressWarnings(\"checkstyle:MagicNumber\")\n public void testUtf8Truncate() {\n String s = \"aÉbÔc\";\n byte[] utf8 = s.getBytes(StandardCharsets.UTF_8);\n Assert.assertEquals(7, utf8.length);\n\n int count;\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 1);\n Assert.assertEquals(1, count);\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 2);\n Assert.assertEquals(1, count); \/\/ É is 2 bytes-wide\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 3);\n Assert.assertEquals(3, count);\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 4);\n Assert.assertEquals(4, count);\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 5);\n Assert.assertEquals(4, count); \/\/ Ô is 2 bytes-wide\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 6);\n Assert.assertEquals(6, count);\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 7);\n Assert.assertEquals(7, count);\n\n count = StringUtils.getUtf8TruncationIndex(utf8, 8);\n Assert.assertEquals(7, count); \/\/ no more chars\n }\n}\n","subject":"Fix typo in test name"} {"old_contents":"\/** EstimotoServiceUtil.java ---\n *\n * Copyright (C) 2014 Dmitry Mozgin\n *\n * Author: Dmitry Mozgin \n *\n *\n *\/\n\npackage com.m039.estimoto.util;\n\nimport android.content.Context;\nimport android.content.Intent;\n\nimport com.m039.estimoto.service.EstimotoService;\n\n\/**\n *\n *\n * Created: 03\/22\/14\n *\n * @author Dmitry Mozgin\n * @version\n * @since\n *\/\npublic class EstimotoServiceUtil {\n\n public static void turnOn(Context ctx) {\n Intent intent = newEstimotoIntent(ctx, EstimotoService.ACTION_CONTROL);\n intent.putExtra(EstimotoService.EXTRA_TURN_ON, true);\n ctx.startService(intent);\n }\n\n public static void turnOff(Context ctx) {\n Intent intent = newEstimotoIntent(ctx, EstimotoService.ACTION_CONTROL);\n intent.putExtra(EstimotoService.EXTRA_TURN_OFF, true);\n ctx.startService(intent);\n }\n\n private static Intent newEstimotoIntent(Context ctx, String action) {\n Intent intent = new Intent(ctx, EstimotoService.class);\n intent.setAction(action);\n return intent;\n }\n\n} \/\/ EstimotoServiceUtil\n","new_contents":"\/** EstimotoServiceUtil.java ---\n *\n * Copyright (C) 2014 Dmitry Mozgin\n *\n * Author: Dmitry Mozgin \n *\n *\n *\/\n\npackage com.m039.estimoto.util;\n\nimport android.content.Context;\nimport android.content.Intent;\n\nimport com.m039.estimoto.service.EstimotoService;\n\n\/**\n *\n *\n * Created: 03\/22\/14\n *\n * @author Dmitry Mozgin\n * @version\n * @since\n *\/\npublic class EstimotoServiceUtil {\n\n public static void turnOn(Context ctx) {\n Intent intent = newEstimotoIntent(ctx, EstimotoService.ACTION_CONTROL);\n intent.putExtra(EstimotoService.EXTRA_TURN_ON, true);\n ctx.startService(intent);\n }\n\n public static void turnOff(Context ctx) {\n Intent intent = newEstimotoIntent(ctx, EstimotoService.ACTION_CONTROL);\n intent.putExtra(EstimotoService.EXTRA_TURN_OFF, true);\n ctx.startService(intent);\n ctx.stopService(intent); \/\/ hack\n }\n\n private static Intent newEstimotoIntent(Context ctx, String action) {\n Intent intent = new Intent(ctx, EstimotoService.class);\n intent.setAction(action);\n return intent;\n }\n\n} \/\/ EstimotoServiceUtil\n","subject":"Add hack to stop service"} {"old_contents":"package de.retest.recheck.ui.descriptors;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class ElementUtil {\n\n\tprivate ElementUtil() {}\n\n\tpublic static List flattenAllElements( final List elements ) {\n\t\tfinal List flattened = new ArrayList<>();\n\n\t\tfor ( final Element element : elements ) {\n\t\t\tflattened.add( element );\n\t\t\tflattened.addAll( flattenChildElements( element ) );\n\t\t}\n\n\t\treturn flattened;\n\t}\n\n\tpublic static List flattenChildElements( final Element element ) {\n\t\tfinal List flattened = new ArrayList<>();\n\n\t\tfor ( final Element childElement : element.getContainedElements() ) {\n\t\t\tflattened.add( childElement );\n\t\t\tflattened.addAll( flattenChildElements( childElement ) );\n\t\t}\n\n\t\treturn flattened;\n\t}\n\n\tpublic static boolean pathEquals( final Element element0, final Element element1 ) {\n\t\treturn element0.getIdentifyingAttributes().getPathTyped()\n\t\t\t\t.equals( element1.getIdentifyingAttributes().getPathTyped() );\n\t}\n}\n","new_contents":"package de.retest.recheck.ui.descriptors;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class ElementUtil {\n\n\tprivate ElementUtil() {}\n\n\tpublic static List flattenAllElements( final List elements ) {\n\t\tfinal List flattened = new ArrayList<>();\n\n\t\tfor ( final Element element : elements ) {\n\t\t\tflattened.add( element );\n\t\t\tflattened.addAll( flattenChildElements( element ) );\n\t\t}\n\n\t\treturn flattened;\n\t}\n\n\tpublic static List flattenChildElements( final Element element ) {\n\t\tfinal List flattened = new ArrayList<>();\n\n\t\tfor ( final Element childElement : element.getContainedElements() ) {\n\t\t\tflattened.add( childElement );\n\t\t\tflattened.addAll( flattenChildElements( childElement ) );\n\t\t}\n\n\t\treturn flattened;\n\t}\n\n\tpublic static boolean pathEquals( final Element element0, final Element element1 ) {\n\t\treturn element0.getIdentifyingAttributes().getPathTyped()\n\t\t\t\t.equals( element1.getIdentifyingAttributes().getPathTyped() );\n\t}\n}\n","subject":"Use wildcard to also accept e.g. list of `RootElement`s"} {"old_contents":"package com.avairebot.orion.commands.utility;\n\nimport com.avairebot.orion.Orion;\nimport com.avairebot.orion.contracts.commands.AbstractCommand;\nimport com.avairebot.orion.factories.MessageFactory;\nimport net.dv8tion.jda.core.entities.Message;\n\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class InviteCommand extends AbstractCommand {\n public InviteCommand(Orion orion) {\n super(orion);\n }\n\n @Override\n public String getName() {\n return \"Invite Command\";\n }\n\n @Override\n public String getDescription() {\n return \"Returns a link that can be used to invite to bot to other servers.\";\n }\n\n @Override\n public List getUsageInstructions() {\n return Collections.singletonList(\"`!invite` - Gives you an invite link that can be used to invite Orion to servers.\");\n }\n\n @Override\n public List getTriggers() {\n return Arrays.asList(\"invite\", \"join\");\n }\n\n @Override\n public boolean onCommand(Message message, String[] args) {\n MessageFactory.makeInfo(message,\n \"You can invite me to your server by [clicking here](%s) or use the link below:\\n\\n%s\",\n orion.config.botAuth().getOAuth(), orion.config.botAuth().getOAuth())\n .queue();\n\n return true;\n }\n}\n","new_contents":"package com.avairebot.orion.commands.utility;\n\nimport com.avairebot.orion.Orion;\nimport com.avairebot.orion.contracts.commands.AbstractCommand;\nimport com.avairebot.orion.factories.MessageFactory;\nimport net.dv8tion.jda.core.entities.Message;\n\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class InviteCommand extends AbstractCommand {\n public InviteCommand(Orion orion) {\n super(orion);\n }\n\n @Override\n public String getName() {\n return \"Invite Command\";\n }\n\n @Override\n public String getDescription() {\n return \"Returns a link that can be used to invite the bot to other servers.\";\n }\n\n @Override\n public List getUsageInstructions() {\n return Collections.singletonList(\"`!invite` - Gives you an invite link that can be used to invite Orion to servers.\");\n }\n\n @Override\n public List getTriggers() {\n return Arrays.asList(\"invite\", \"join\");\n }\n\n @Override\n public boolean onCommand(Message message, String[] args) {\n MessageFactory.makeInfo(message,\n \"You can invite me to your server by [clicking here](%s) or use the link below:\\n\\n%s\",\n orion.config.botAuth().getOAuth(), orion.config.botAuth().getOAuth())\n .queue();\n\n return true;\n }\n}\n","subject":"Fix spelling mistake in invite command description"} {"old_contents":"package es.tid.ps.dynamicprofile.categoryextraction;\n\nimport java.io.IOException;\n\nimport org.apache.hadoop.mapreduce.Reducer;\n\nimport es.tid.ps.dynamicprofile.dictionary.DictionaryHandler;\nimport es.tid.ps.kpicalculation.data.WebLog;\n\npublic class CategoryExtractionReducer extends\n Reducer {\n private final static String CATEGORY_DELIMITER = \"\/\";\n\n @Override\n public void setup(Context context) throws IOException {\n DictionaryHandler.init(\"\", \"\", \"\", \"\");\n }\n\n @Override\n protected void reduce(CompositeKey key, Iterable values,\n Context context) throws IOException, InterruptedException {\n \/\/ Use the comScore API\n String url = values.iterator().next().fullUrl;\n String categories = DictionaryHandler.getUrlCategories(url);\n\n \/\/ Count the number of instances of the same URL\n long count = 0;\n while (values.iterator().hasNext()) {\n count++;\n }\n\n CategoryInformation cat = new CategoryInformation(key.getPrimaryKey(),\n key.getSecondaryKey(), count,\n categories.split(CATEGORY_DELIMITER));\n context.write(key, cat);\n }\n}\n","new_contents":"package es.tid.ps.dynamicprofile.categoryextraction;\n\nimport java.io.IOException;\n\nimport org.apache.hadoop.mapreduce.Reducer;\n\nimport es.tid.ps.dynamicprofile.dictionary.DictionaryHandler;\nimport es.tid.ps.kpicalculation.data.WebLog;\n\npublic class CategoryExtractionReducer extends\n Reducer {\n private final static String CATEGORY_DELIMITER = \"\/\";\n\n @Override\n public void setup(Context context) throws IOException {\n DictionaryHandler.init(\n context.getConfiguration().get(\"termsInDomainFlatFileName\"),\n context.getConfiguration().get(\"dictionaryFileName\"),\n context.getConfiguration().get(\"categoryPatterMappingFileName\"),\n context.getConfiguration().get(\"categoryNamesFileName\"));\n }\n\n @Override\n protected void reduce(CompositeKey key, Iterable values,\n Context context) throws IOException, InterruptedException {\n \/\/ Use the comScore API\n String url = values.iterator().next().fullUrl;\n String categories = DictionaryHandler.getUrlCategories(url);\n\n \/\/ Count the number of instances of the same URL\n long count = 0;\n while (values.iterator().hasNext()) {\n count++;\n }\n\n CategoryInformation cat = new CategoryInformation(key.getPrimaryKey(),\n key.getSecondaryKey(), count,\n categories.split(CATEGORY_DELIMITER));\n context.write(key, cat);\n }\n}\n","subject":"Add configuration parameters to the reducer."} {"old_contents":"package fr.synchrotron.soleil.ica.ci.service.legacymavenproxy;\n\nimport org.vertx.java.core.Vertx;\nimport org.vertx.java.core.http.HttpClient;\nimport org.vertx.java.core.http.HttpServerRequest;\n\n\/**\n * @author Gregory Boissinot\n *\/\npublic class HttpArtifactCaller {\n\n private final Vertx vertx;\n private final String repoHost;\n private final int repoPort;\n private final String repoURIPath;\n\n public HttpArtifactCaller(Vertx vertx,\n String repoHost, int repoPort, String repoURIPath) {\n this.vertx = vertx;\n this.repoHost = repoHost;\n this.repoPort = repoPort;\n this.repoURIPath = repoURIPath;\n }\n\n\n public Vertx getVertx() {\n return vertx;\n }\n\n public String getRepoHost() {\n return repoHost;\n }\n\n public String buildRequestPath(final HttpServerRequest request) {\n\n final String prefix = \"\/maven\";\n String artifactPath = request.path().substring(prefix.length() + 1);\n return repoURIPath.endsWith(\"\/\") ? (repoURIPath + artifactPath) : (repoURIPath + \"\/\" + artifactPath);\n }\n\n public HttpClient getPClient() {\n return getVertx().createHttpClient()\n .setHost(repoHost)\n .setPort(repoPort)\n .setConnectTimeout(10000);\n }\n\n}\n","new_contents":"package fr.synchrotron.soleil.ica.ci.service.legacymavenproxy;\n\nimport org.vertx.java.core.Vertx;\nimport org.vertx.java.core.http.HttpClient;\nimport org.vertx.java.core.http.HttpServerRequest;\n\n\/**\n * @author Gregory Boissinot\n *\/\npublic class HttpArtifactCaller {\n\n private final Vertx vertx;\n private final String repoHost;\n private final int repoPort;\n private final String repoURIPath;\n\n public HttpArtifactCaller(Vertx vertx,\n String repoHost, int repoPort, String repoURIPath) {\n this.vertx = vertx;\n this.repoHost = repoHost;\n this.repoPort = repoPort;\n this.repoURIPath = repoURIPath;\n }\n\n\n public Vertx getVertx() {\n return vertx;\n }\n\n public String getRepoHost() {\n return repoHost;\n }\n\n public String buildRequestPath(final HttpServerRequest request) {\n\n final String prefix = HttpArtifactProxyEndpointVerticle.PROXY_PATH;\n String artifactPath = request.path().substring(prefix.length() + 1);\n return repoURIPath.endsWith(\"\/\") ? (repoURIPath + artifactPath) : (repoURIPath + \"\/\" + artifactPath);\n }\n\n public HttpClient getPClient() {\n return getVertx().createHttpClient()\n .setHost(repoHost)\n .setPort(repoPort)\n .setConnectTimeout(10000);\n }\n\n}\n","subject":"Fix regression Use the proxy path"} {"old_contents":"package com.clinicpatientqueueexample.messaging;\n\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.ConcurrentLinkedQueue;\nimport java.util.concurrent.ConcurrentMap;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.function.Consumer;\n\npublic abstract class AbstractBroadcaster {\n\n private final ConcurrentMap>> listeners = new ConcurrentHashMap<>();\n private final ExecutorService executorService = Executors.newSingleThreadExecutor();\n\n public void register(String topic, Consumer listener) {\n ConcurrentLinkedQueue> topicListeners = listeners.putIfAbsent(topic, new ConcurrentLinkedQueue<>());\n if (topicListeners == null) {\n topicListeners = listeners.get(topic);\n }\n topicListeners.add(listener);\n }\n\n public void unregister(String topic, Consumer listener) {\n final ConcurrentLinkedQueue> topicListeners = listeners.get(topic);\n if (topicListeners != null) {\n topicListeners.remove(listener);\n }\n }\n\n public void broadcast(String topic, String message) {\n final ConcurrentLinkedQueue> topicListeners = listeners.get(topic);\n if (topicListeners != null) {\n for (final Consumer listener : topicListeners) {\n executorService.execute(() -> listener.accept(message));\n }\n }\n }\n\n}\n","new_contents":"package com.clinicpatientqueueexample.messaging;\n\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.ConcurrentLinkedQueue;\nimport java.util.concurrent.ConcurrentMap;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.function.Consumer;\n\npublic abstract class AbstractBroadcaster {\n\n private final ConcurrentMap>> listeners = new ConcurrentHashMap<>();\n private final ExecutorService executorService = Executors.newSingleThreadExecutor();\n\n public void register(String topic, Consumer listener) {\n ConcurrentLinkedQueue> topicListeners = listeners.putIfAbsent(topic, new ConcurrentLinkedQueue<>());\n if (topicListeners == null) {\n topicListeners = listeners.get(topic);\n }\n topicListeners.add(listener);\n }\n\n public void unregister(String topic, Consumer listener) {\n final ConcurrentLinkedQueue> topicListeners = listeners.get(topic);\n if (topicListeners == null) {\n return;\n }\n topicListeners.remove(listener);\n if (topicListeners.isEmpty()) {\n listeners.remove(topic);\n }\n }\n\n public void broadcast(String topic, String message) {\n final ConcurrentLinkedQueue> topicListeners = listeners.get(topic);\n if (topicListeners != null) {\n for (final Consumer listener : topicListeners) {\n executorService.execute(() -> listener.accept(message));\n }\n }\n }\n\n}\n","subject":"Remove listeners object from broadcaster if topic is empty"} {"old_contents":"package io.syndesis.qe;\n\nimport org.junit.BeforeClass;\nimport org.junit.runner.RunWith;\n\nimport com.codeborne.selenide.Configuration;\n\nimport cucumber.api.CucumberOptions;\nimport cucumber.api.junit.Cucumber;\n\n@RunWith(Cucumber.class)\n@CucumberOptions(\n features = \"classpath:features\",\n tags = {\"not @wip\", \"not @manual\", \"not @deprecated\", \"not @disabled\", \"not @extension\"},\n format = {\"pretty\", \"html:target\/cucumber\/cucumber-html\", \"junit:target\/cucumber\/cucumber-junit.xml\", \"json:target\/cucumber\/cucumber-report.json\"}\n)\npublic class CucumberTest extends TestSuiteParent {\n\n @BeforeClass\n public static void setupCucumber() {\n \/\/set up Selenide\n Configuration.timeout = TestConfiguration.getConfigTimeout() * 1000;\n Configuration.collectionsTimeout = Configuration.timeout;\n \/\/We will now use custom web driver\n \/\/Configuration.browser = TestConfiguration.syndesisBrowser();\n Configuration.browser = \"io.syndesis.qe.CustomWebDriverProvider\";\n Configuration.browserSize= \"1920x1080\";\n }\n\n}\n","new_contents":"package io.syndesis.qe;\n\nimport com.codeborne.selenide.Configuration;\nimport cucumber.api.CucumberOptions;\nimport cucumber.api.junit.Cucumber;\nimport org.junit.BeforeClass;\nimport org.junit.runner.RunWith;\n\n@RunWith(Cucumber.class)\n@CucumberOptions(\n features = \"classpath:features\",\n tags = {\"not @wip\", \"not @manual\", \"not @deprecated\", \"not @disabled\"},\n format = {\"pretty\", \"html:target\/cucumber\/cucumber-html\", \"junit:target\/cucumber\/cucumber-junit.xml\", \"json:target\/cucumber\/cucumber-report.json\"}\n)\npublic class CucumberTest extends TestSuiteParent {\n\n @BeforeClass\n public static void setupCucumber() {\n \/\/set up Selenide\n Configuration.timeout = TestConfiguration.getConfigTimeout() * 1000;\n Configuration.collectionsTimeout = Configuration.timeout;\n \/\/We will now use custom web driver\n \/\/Configuration.browser = TestConfiguration.syndesisBrowser();\n Configuration.browser = \"io.syndesis.qe.CustomWebDriverProvider\";\n Configuration.browserSize= \"1920x1080\";\n }\n\n}\n","subject":"Revert \"[GH-4308] Temporary disable all tests with extensions\""} {"old_contents":"package org.musetest.commandline;\n\nimport io.airlift.airline.*;\nimport org.musetest.core.commandline.*;\nimport org.reflections.*;\n\nimport javax.imageio.spi.*;\nimport java.util.*;\n\n\/**\n * @author Christopher L Merrill (see LICENSE.txt for license details)\n *\/\npublic class Launcher\n {\n @SuppressWarnings(\"unchecked\")\n public static void main(String[] args)\n {\n \/\/ dynamically lookup the commands using Java's ServiceRegistry. This looks at the META-INF\/service files in jars on the classpath.\n Iterator commands = ServiceRegistry.lookupProviders(MuseCommand.class);\n List> implementors = new ArrayList<>();\n while (commands.hasNext())\n implementors.add((commands.next().getClass()));\n\n Cli.CliBuilder builder = Cli.builder(\"muse\")\n .withDescription(\"Muse command-line tools\")\n .withDefaultCommand(Help.class)\n .withCommands(Help.class)\n .withCommands(implementors);\n Cli muse_parser = builder.build();\n\n try\n {\n muse_parser.parse(args).run();\n }\n catch (Exception e)\n {\n muse_parser.parse(new String[0]).run();\n }\n }\n\n static\n {\n Reflections.log = null;\n }\n }\n\n\n","new_contents":"package org.musetest.commandline;\n\nimport io.airlift.airline.*;\nimport org.musetest.core.commandline.*;\nimport org.reflections.*;\n\nimport javax.imageio.spi.*;\nimport java.util.*;\n\n\/**\n * @author Christopher L Merrill (see LICENSE.txt for license details)\n *\/\npublic class Launcher\n {\n @SuppressWarnings(\"unchecked\")\n public static void main(String[] args)\n {\n \/\/ dynamically lookup the commands using Java's ServiceRegistry. This looks at the META-INF\/service files in jars on the classpath.\n Iterator commands = ServiceRegistry.lookupProviders(MuseCommand.class);\n List> implementors = new ArrayList<>();\n while (commands.hasNext())\n implementors.add((commands.next().getClass()));\n\n Cli.CliBuilder builder = Cli.builder(\"muse\")\n .withDescription(\"Muse command-line tools\")\n .withDefaultCommand(Help.class)\n .withCommands(Help.class)\n .withCommands(implementors);\n Cli muse_parser = builder.build();\n\n\t\tfinal Runnable command;\n\t\ttry\n {\n\t\t\tcommand = muse_parser.parse(args);\n }\n catch (Exception e)\n {\n muse_parser.parse(new String[0]).run();\n return;\n }\n try\n {\n command.run();\n }\n catch (Exception e)\n {\n\t\t\tSystem.out.println(String.format(\"Command failed due to a %s.\\n%s\", e.getClass().getSimpleName(), e.getMessage()));\n\t\t\te.printStackTrace(System.err);\n\t\t\t}\n }\n\n static\n {\n Reflections.log = null;\n }\n }\n\n\n","subject":"Handle command-line parsing errors separately from command execution errors."} {"old_contents":"package org.axonframework.config;\n\n\/**\n * Interface describing a configurer for a module in the Axon Configuration API. Allows the registration of modules on\n * the {@link org.axonframework.config.Configurer} like the {@link org.axonframework.monitoring.MessageMonitor}.\n *\n * @author Steven van Beelen\n * @since 3.2\n *\/\npublic interface ConfigurerModule {\n\n \/**\n * Configure this module to the given global {@link org.axonframework.config.Configurer}.\n *\n * @param configurer a {@link org.axonframework.config.Configurer} instance to configure this module with\n *\/\n void configureModule(Configurer configurer);\n}\n","new_contents":"package org.axonframework.config;\n\n\/**\n * Interface describing a configurer for a module in the Axon Configuration API. Allows the registration of modules on\n * the {@link org.axonframework.config.Configurer} like the {@link org.axonframework.monitoring.MessageMonitor}.\n *\n * @author Steven van Beelen\n * @since 3.2\n *\n *\/\npublic interface ConfigurerModule {\n\n \/**\n * Configure this module to the given global {@link org.axonframework.config.Configurer}.\n *\n * @param configurer a {@link org.axonframework.config.Configurer} instance to configure this module with\n *\/\n void configureModule(Configurer configurer);\n}\n","subject":"Replace the noOp constant for a noOp static function"} {"old_contents":"package shoehorn;\n\nimport java.util.Map;\n\n\/**\n * @author Ryan Brainard\n *\/\npublic class Shoehorn {\n\n private final Map feet;\n private final Map mappings;\n\n public Shoehorn(Map feet, Map mappings) {\n this.feet = feet;\n this.mappings = mappings;\n }\n\n void shoehorn() {\n for (Map.Entry foot : feet.entrySet()) {\n if (!mappings.containsKey(foot.getKey())) {\n continue;\n }\n\n final String[] shoeKeys;\n if (mappings.get(foot.getKey()).trim().equals(\"\")) {\n shoeKeys = new String[]{foot.getKey()};\n } else {\n shoeKeys = mappings.get(foot.getKey()).split(\" \");\n }\n\n for (String shoeKey : shoeKeys) {\n System.setProperty(shoeKey, foot.getValue());\n System.out.println(\"Shoehorned [\" + foot.getKey() + \"] into [\" + shoeKey + \"]\");\n }\n }\n }\n\n @SuppressWarnings(\"UnusedDeclaration\")\n public static void premain(String agentArgs) {\n new Shoehorn(System.getenv(), new MappingLoader().load(System.getenv())).shoehorn();\n }\n}\n","new_contents":"package shoehorn;\n\nimport java.util.Map;\n\n\/**\n * @author Ryan Brainard\n *\/\npublic class Shoehorn {\n\n @SuppressWarnings(\"UnusedDeclaration\")\n public static void premain(String agentArgs) {\n new Shoehorn(System.getenv(), new MappingLoader().load(System.getenv())).shoehorn();\n }\n\n private final Map feet;\n private final Map mappings;\n\n public Shoehorn(Map feet, Map mappings) {\n this.feet = feet;\n this.mappings = mappings;\n }\n\n void shoehorn() {\n for (Map.Entry foot : feet.entrySet()) {\n if (!mappings.containsKey(foot.getKey())) {\n continue;\n }\n\n final String[] shoeKeys;\n if (mappings.get(foot.getKey()).trim().equals(\"\")) {\n shoeKeys = new String[]{foot.getKey()};\n } else {\n shoeKeys = mappings.get(foot.getKey()).split(\" \");\n }\n\n for (String shoeKey : shoeKeys) {\n System.setProperty(shoeKey, foot.getValue());\n System.out.println(\"Shoehorned [\" + foot.getKey() + \"] into [\" + shoeKey + \"]\");\n }\n }\n }\n}\n","subject":"Move premain to the top"} {"old_contents":"package edu.northwestern.bioinformatics.studycalendar.domain.delta;\n\nimport edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeInnerNode;\nimport edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeNode;\n\nimport javax.persistence.Entity;\nimport javax.persistence.DiscriminatorValue;\nimport javax.persistence.Transient;\nimport javax.persistence.Column;\nimport java.util.Set;\n\nimport org.hibernate.validator.NotNull;\n\n\/**\n * @author Rhett Sutphin\n *\/\n@Entity \/\/ TODO\n@DiscriminatorValue(\"add\")\npublic class Add extends Change {\n private Integer newChildId;\n private Integer index;\n\n @Override\n @Transient\n public ChangeAction getAction() { return ChangeAction.ADD; }\n\n \/\/\/\/\/\/ BEAN PROPERTIES\n\n @Column (name = \"new_value\")\n public Integer getNewChildId() {\n return newChildId;\n }\n\n public void setNewChildId(Integer newChildId) {\n this.newChildId = newChildId;\n }\n\n @Column (name = \"attribute\")\n public Integer getIndex() {\n return index;\n }\n\n public void setIndex(Integer index) {\n this.index = index;\n }\n\n @Override\n public String toString() {\n StringBuilder sb = new StringBuilder(getClass().getSimpleName())\n .append(\"[id=\").append(getId()).append(\"; child id \").append(getNewChildId());\n if (getIndex() != null) {\n sb.append(\" at index \").append(getIndex());\n }\n return sb.append(']').toString();\n }\n}\n","new_contents":"package edu.northwestern.bioinformatics.studycalendar.domain.delta;\n\nimport edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeInnerNode;\nimport edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeNode;\n\nimport javax.persistence.Entity;\nimport javax.persistence.DiscriminatorValue;\nimport javax.persistence.Transient;\nimport javax.persistence.Column;\nimport java.util.Set;\n\nimport org.hibernate.validator.NotNull;\n\n\/**\n * @author Rhett Sutphin\n *\/\n@Entity\n@DiscriminatorValue(\"add\")\npublic class Add extends Change {\n private Integer newChildId;\n private Integer index;\n\n @Override\n @Transient\n public ChangeAction getAction() { return ChangeAction.ADD; }\n\n \/\/\/\/\/\/ BEAN PROPERTIES\n\n @Column (name = \"new_value\")\n public Integer getNewChildId() {\n return newChildId;\n }\n\n public void setNewChildId(Integer newChildId) {\n this.newChildId = newChildId;\n }\n\n @Column (name = \"attribute\")\n public Integer getIndex() {\n return index;\n }\n\n public void setIndex(Integer index) {\n this.index = index;\n }\n\n @Override\n public String toString() {\n StringBuilder sb = new StringBuilder(getClass().getSimpleName())\n .append(\"[id=\").append(getId()).append(\"; child id \").append(getNewChildId());\n if (getIndex() != null) {\n sb.append(\" at index \").append(getIndex());\n }\n return sb.append(']').toString();\n }\n}\n","subject":"Remove TODO for done thing"} {"old_contents":"\/**\r\n * \r\n *\/\r\npackage gov.nih.nci.nbia.dto;\r\n\r\nimport junit.framework.TestCase;\r\n\r\n\/**\r\n * @author lethai\r\n *\r\n *\/\r\npublic class ImageDTOTestCase extends TestCase {\r\n\tpublic void testAccessors() {\r\n\t\t\r\n\t\tString SOPInstanceUID=\"1.2.3.4.5.6\";\r\n\t\tString fileName=\"1.2.3.4.5.6.7.dcm\";\r\n\t\tLong dicomSize = new Long(514);\r\n\t\tString project=\"RIDER\";\r\n\t\tString site=\"RIDER\";\r\n\t\tString ssg=\"test\";\r\n \r\n ImageDTO imageDTO = new ImageDTO(SOPInstanceUID, fileName, dicomSize, project, site, ssg);\r\n\r\n assertTrue(imageDTO.getSOPInstanceUID().equals(\"1.2.3.4.5.6\"));\r\n assertTrue(imageDTO.getFileName().equals(\"1.2.3.4.5.6.7.dcm\")); \r\n assertTrue(imageDTO.getDicomSize() ==514L);\r\n assertTrue(imageDTO.getProject().equals(\"RIDER\"));\t\r\n assertTrue(imageDTO.getSite().equals(\"RIDER\"));\t\r\n assertTrue(imageDTO.getSsg().equals(\"test\"));\t\r\n }\r\n}","new_contents":"\/**\r\n * \r\n *\/\r\npackage gov.nih.nci.nbia.dto;\r\n\r\nimport junit.framework.TestCase;\r\n\r\n\/**\r\n * @author lethai\r\n *\r\n *\/\r\npublic class ImageDTOTestCase extends TestCase {\r\n\tpublic void testAccessors() {\r\n\t\t\r\n\t\tString SOPInstanceUID=\"1.2.3.4.5.6\";\r\n\t\tString fileName=\"1.2.3.4.5.6.7.dcm\";\r\n\t\tLong dicomSize = new Long(514);\r\n\t\tString project=\"RIDER\";\r\n\t\tString site=\"RIDER\";\r\n\t\tString ssg=\"test\";\r\n\t\tint frameNum = 0;\r\n \r\n ImageDTO imageDTO = new ImageDTO(SOPInstanceUID, fileName, dicomSize, project, site, ssg, 0);\r\n\r\n assertTrue(imageDTO.getSOPInstanceUID().equals(\"1.2.3.4.5.6\"));\r\n assertTrue(imageDTO.getFileName().equals(\"1.2.3.4.5.6.7.dcm\")); \r\n assertTrue(imageDTO.getDicomSize() ==514L);\r\n assertTrue(imageDTO.getProject().equals(\"RIDER\"));\t\r\n assertTrue(imageDTO.getSite().equals(\"RIDER\"));\t\r\n assertTrue(imageDTO.getSsg().equals(\"test\"));\t\r\n }\r\n}","subject":"Make it compatible for updated ImageDTO class."} {"old_contents":"package info.u_team.u_team_core.api.construct;\n\nimport java.lang.annotation.*;\n\n@Retention(RetentionPolicy.RUNTIME)\n@Target(ElementType.TYPE)\npublic @interface Construct {\n\t\n\tboolean client() default false;\n\t\n\tString modid() default \"\";\n\t\n}\n","new_contents":"package info.u_team.u_team_core.api.construct;\n\nimport java.lang.annotation.*;\n\n@Retention(RetentionPolicy.RUNTIME)\n@Target(ElementType.TYPE)\npublic @interface Construct {\n\t\n\tboolean client() default false;\n\t\n}\n","subject":"Remove modid stuff for now (might be needed)"} {"old_contents":"\/*\n * Copyright 2017 EPAM Systems\n *\n *\n * This file is part of EPAM Report Portal.\n * https:\/\/github.com\/reportportal\/service-api\n *\n * Report Portal is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * Report Portal is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with Report Portal. If not, see .\n *\/\n\npackage com.epam.ta.reportportal.dao;\n\nimport com.epam.ta.reportportal.entity.widget.Widget;\n\n\/**\n * @author Pavel Bortnik\n *\/\npublic interface WidgetRepository extends ReportPortalRepository {\n}\n","new_contents":"\/*\n * Copyright 2017 EPAM Systems\n *\n *\n * This file is part of EPAM Report Portal.\n * https:\/\/github.com\/reportportal\/service-api\n *\n * Report Portal is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * Report Portal is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with Report Portal. If not, see .\n *\/\n\npackage com.epam.ta.reportportal.dao;\n\nimport com.epam.ta.reportportal.entity.widget.Widget;\n\nimport java.util.List;\n\n\/**\n * @author Pavel Bortnik\n *\/\npublic interface WidgetRepository extends ReportPortalRepository {\n\n\tList findAllByProjectId(Long projectId);\n}\n","subject":"Add method finding all widgets by project id"} {"old_contents":"package aeronicamc.mods.mxtune.caps;\n\nimport aeronicamc.mods.mxtune.managers.PlayIdSupplier;\nimport aeronicamc.mods.mxtune.network.PacketDispatcher;\nimport aeronicamc.mods.mxtune.network.messages.LivingEntityModCapSync;\nimport net.minecraft.entity.LivingEntity;\nimport net.minecraft.util.RegistryKey;\nimport net.minecraft.world.World;\n\nimport javax.annotation.Nullable;\n\npublic class LivingEntityModCap implements ILivingEntityModCap\n{\n private int playId = PlayIdSupplier.PlayType.INVALID.getAsInt();\n private final LivingEntity entity;\n\n LivingEntityModCap(@Nullable final LivingEntity entity)\n {\n this.entity = entity;\n }\n\n @Override\n public void setPlayId(int playId)\n {\n this.playId = playId;\n synchronize();\n }\n\n @Override\n public int getPlayId()\n {\n return playId;\n }\n\n @Override\n public void synchronize()\n {\n if (entity == null) return;\n World world = entity.level;\n if (world.isClientSide) return;\n RegistryKey dimension = world.dimension();\n PacketDispatcher.sendToDimension(new LivingEntityModCapSync(playId), dimension);\n }\n}\n","new_contents":"package aeronicamc.mods.mxtune.caps;\n\nimport aeronicamc.mods.mxtune.managers.PlayIdSupplier;\nimport aeronicamc.mods.mxtune.network.PacketDispatcher;\nimport aeronicamc.mods.mxtune.network.messages.LivingEntityModCapSync;\nimport net.minecraft.entity.LivingEntity;\nimport net.minecraft.util.RegistryKey;\nimport net.minecraft.world.World;\n\nimport javax.annotation.Nullable;\n\npublic class LivingEntityModCap implements ILivingEntityModCap\n{\n private int playId = PlayIdSupplier.PlayType.INVALID.getAsInt();\n private final LivingEntity entity;\n\n LivingEntityModCap(@Nullable final LivingEntity entity)\n {\n this.entity = entity;\n }\n\n @Override\n public void setPlayId(int playId)\n {\n this.playId = playId;\n synchronize();\n }\n\n @Override\n public int getPlayId()\n {\n return playId;\n }\n\n @Override\n public void synchronize()\n {\n if (entity == null) return;\n World world = entity.level;\n if (world.isClientSide) return;\n RegistryKey dimension = world.dimension();\n PacketDispatcher.sendToDimension(new LivingEntityModCapSync(playId, entity.getId()), dimension);\n }\n}\n","subject":"Add entity id to sync message."} {"old_contents":"\/*\n * Copyright (C) 2012 VSPLF Software Foundation (VSF)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.vsplf.i18n;\n\n\/**\n * The application entry point for bootstrap.\n *\n * @author hoatle (hoatlevan at gmail dot com)<\/a>\n * @since 2\/23\/12\n *\/\npublic class DynamicI18N {\n\n public static TranslatorFactory buildDefaultTranslatorFactory() {\n return null;\n }\n}\n","new_contents":"\/*\n * Copyright (C) 2012 VSPLF Software Foundation (VSF)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.vsplf.i18n;\n\n\/**\n * The application entry point.\n *\n * @author hoatle (hoatlevan at gmail dot com)<\/a>\n * @since Feb 23, 2012\n *\/\npublic final class DynamicI18N {\n\n private DynamicI18N() {\n\n }\n\n public static TranslatorFactory buildDefaultTranslatorFactory() {\n return null;\n }\n}\n","subject":"Fix a violation of Helper class"} {"old_contents":"package replicant.spy;\n\nimport arez.spy.SerializableEvent;\nimport java.util.Map;\nimport java.util.Objects;\nimport javax.annotation.Nonnull;\nimport org.realityforge.replicant.client.transport.DataLoadStatus;\n\n\/**\n * Notification when an DataLoader generated an error processing a message from the datasource.\n *\/\npublic final class DataLoaderMessageProcessEvent\n implements SerializableEvent\n{\n @Nonnull\n private final Class _systemType;\n @Nonnull\n private final DataLoadStatus _dataLoadStatus;\n\n public DataLoaderMessageProcessEvent( @Nonnull final Class systemType,\n @Nonnull final DataLoadStatus dataLoadStatus )\n {\n _systemType = Objects.requireNonNull( systemType );\n _dataLoadStatus = Objects.requireNonNull( dataLoadStatus );\n }\n\n @Nonnull\n public Class getSystemType()\n {\n return _systemType;\n }\n\n @Nonnull\n public DataLoadStatus getDataLoadStatus()\n {\n return _dataLoadStatus;\n }\n\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public void toMap( @Nonnull final Map map )\n {\n map.put( \"type\", \"DataLoader.MessageProcess\" );\n map.put( \"systemType\", getSystemType().getSimpleName() );\n }\n}\n","new_contents":"package replicant.spy;\n\nimport arez.spy.SerializableEvent;\nimport java.util.Map;\nimport java.util.Objects;\nimport javax.annotation.Nonnull;\nimport org.realityforge.replicant.client.transport.DataLoadStatus;\n\n\/**\n * Notification when an DataLoader generated an error processing a message from the datasource.\n *\/\npublic final class DataLoaderMessageProcessEvent\n implements SerializableEvent\n{\n @Nonnull\n private final Class _systemType;\n @Nonnull\n private final DataLoadStatus _dataLoadStatus;\n\n public DataLoaderMessageProcessEvent( @Nonnull final Class systemType,\n @Nonnull final DataLoadStatus dataLoadStatus )\n {\n _systemType = Objects.requireNonNull( systemType );\n _dataLoadStatus = Objects.requireNonNull( dataLoadStatus );\n }\n\n @Nonnull\n public Class getSystemType()\n {\n return _systemType;\n }\n\n @Nonnull\n public DataLoadStatus getDataLoadStatus()\n {\n return _dataLoadStatus;\n }\n\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public void toMap( @Nonnull final Map map )\n {\n map.put( \"type\", \"DataLoader.MessageProcess\" );\n map.put( \"systemType\", getSystemType().getSimpleName() );\n final DataLoadStatus status = getDataLoadStatus();\n map.put( \"sequence\", status.getSequence() );\n map.put( \"requestId\", status.getRequestID() );\n map.put( \"channelAddCount\", status.getChannelAddCount() );\n map.put( \"channelRemoveCount\", status.getChannelRemoveCount() );\n map.put( \"channelUpdateCount\", status.getChannelUpdateCount() );\n map.put( \"entityUpdateCount\", status.getEntityUpdateCount() );\n map.put( \"entityRemoveCount\", status.getEntityRemoveCount() );\n map.put( \"entityLinkCount\", status.getEntityLinkCount() );\n }\n}\n","subject":"Add aditional information to serialization"} {"old_contents":"package uk.ac.ebi.quickgo.rest.period;\n\nimport java.time.DayOfWeek;\nimport java.time.LocalTime;\nimport org.junit.Test;\n\n\/**\n * Test instantiation of the DayTime class.\n *\n * @author Tony Wardell\n * Date: 18\/04\/2017\n * Time: 10:43\n * Created with IntelliJ IDEA.\n *\/\npublic class DayTimeTest {\n\n @Test\n public void instantiateDayTimeWithValidValues(){\n new DayTime(DayOfWeek.FRIDAY, LocalTime.of(12, 37));\n }\n\n @Test(expected = IllegalArgumentException.class)\n public void nullDayOfWeekCreatesException(){\n new DayTime(null, LocalTime.of(12, 37));\n }\n\n @Test(expected = IllegalArgumentException.class)\n public void nullLocalTimeCreatesException(){\n new DayTime(DayOfWeek.FRIDAY, null);\n }\n}\n","new_contents":"package uk.ac.ebi.quickgo.rest.period;\n\nimport java.time.DayOfWeek;\nimport java.time.LocalDateTime;\nimport java.time.LocalTime;\nimport org.junit.Test;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.hamcrest.core.IsNull.notNullValue;\n\n\/**\n * Test instantiation of the DayTime class.\n *\n * @author Tony Wardell\n * Date: 18\/04\/2017\n * Time: 10:43\n * Created with IntelliJ IDEA.\n *\/\npublic class DayTimeTest {\n\n @Test\n public void instantiateDayTimeWithValidValues(){\n DayTime validDayTime = new DayTime(DayOfWeek.FRIDAY, LocalTime.of(12, 37));\n\n assertThat(validDayTime, notNullValue());\n }\n\n @Test(expected = IllegalArgumentException.class)\n public void nullDayOfWeekCreatesException(){\n new DayTime(null, LocalTime.of(12, 37));\n }\n\n @Test(expected = IllegalArgumentException.class)\n public void nullLocalTimeCreatesException(){\n new DayTime(DayOfWeek.FRIDAY, null);\n }\n\n @Test\n public void modify(){\n DayTime dayTime = new DayTime(DayOfWeek.FRIDAY, LocalTime.of(12, 37));\n LocalDateTime now = LocalDateTime.now();\n LocalDateTime compared = now.with(DayOfWeek.FRIDAY);\n LocalTime localTime = LocalTime.of(12, 37);\n compared = compared.with(localTime);\n\n LocalDateTime modified = dayTime.modify(now);\n\n assertThat(modified, equalTo(compared));\n }\n}\n","subject":"Add test case for instantiation successfully. Add test for modify();"} {"old_contents":"package ch.squix.esp8266.fontconverter.rest.time;\n\nimport java.awt.FontFormatException;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Locale;\n\nimport org.joda.time.DateTime;\nimport org.joda.time.DateTimeZone;\nimport org.restlet.resource.Post;\nimport org.restlet.resource.ServerResource;\n\npublic class TimeResource extends ServerResource {\n\n @Post(value = \"json\")\n public TimeOutDto execute(TimeInDto inDto) throws FontFormatException, IOException {\n TimeOutDto outDto = new TimeOutDto();\n DateTime dateTime = new DateTime();\n\n Locale locale = new Locale(inDto.getLanguage(), inDto.getCountry());\n outDto.setMillisOfDayUtc(dateTime.getMillisOfDay());\n\n List timeZones = new ArrayList<>();\n outDto.setTimeZoneDto(timeZones);\n\n for (String timeZoneId : inDto.getTimeZoneIds()) {\n DateTimeZone zone = DateTimeZone.forID(timeZoneId);\n DateTime localDateTime = new DateTime(zone);\n TimeZoneDto zoneDto = new TimeZoneDto();\n zoneDto.setIndex(timeZones.size());\n zoneDto.setTimeZoneId(timeZoneId);\n zoneDto.setTimeZoneOffsetToUtcMillis(zone.getOffset(dateTime.getMillis()));\n zoneDto.setFormattedDate(localDateTime.toString(inDto.getDateFormat(), locale));\n timeZones.add(zoneDto);\n\n }\n return outDto;\n }\n\n}\n","new_contents":"package ch.squix.esp8266.fontconverter.rest.time;\n\nimport java.awt.FontFormatException;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Locale;\n\nimport org.joda.time.DateTime;\nimport org.joda.time.DateTimeZone;\nimport org.restlet.resource.Post;\nimport org.restlet.resource.ServerResource;\n\npublic class TimeResource extends ServerResource {\n\n @Post(value = \"json\")\n public TimeOutDto execute(TimeInDto inDto) throws FontFormatException, IOException {\n TimeOutDto outDto = new TimeOutDto();\n DateTime dateTime = new DateTime(DateTimeZone.UTC);\n\n Locale locale = new Locale(inDto.getLanguage(), inDto.getCountry());\n outDto.setMillisOfDayUtc(dateTime.getMillisOfDay());\n\n List timeZones = new ArrayList<>();\n outDto.setTimeZoneDto(timeZones);\n\n for (String timeZoneId : inDto.getTimeZoneIds()) {\n DateTimeZone zone = DateTimeZone.forID(timeZoneId);\n DateTime localDateTime = new DateTime(zone);\n TimeZoneDto zoneDto = new TimeZoneDto();\n zoneDto.setIndex(timeZones.size());\n zoneDto.setTimeZoneId(timeZoneId);\n zoneDto.setTimeZoneOffsetToUtcMillis(zone.getOffset(dateTime.getMillis()));\n zoneDto.setFormattedDate(localDateTime.toString(inDto.getDateFormat(), locale));\n timeZones.add(zoneDto);\n\n }\n return outDto;\n }\n\n}\n","subject":"Set time to utc time"} {"old_contents":"package com.ushahidi.android.data.entity;\n\nimport com.google.gson.annotations.SerializedName;\n\n\/**\n * @author Ushahidi Team \n *\/\npublic abstract class Data {\n\n @SerializedName(\"id\")\n public Long _id;\n}\n","new_contents":"package com.ushahidi.android.data.entity;\n\nimport com.google.gson.annotations.SerializedName;\n\n\/**\n * @author Ushahidi Team \n *\/\npublic abstract class Data {\n\n \/**\n * The id field has an underscore to ensure any existing id value will be\n * replaced. if _id is null then a new entity will be created. This is {@link cupboard()} way\n * of avoiding duplicated IDs\n *\/\n @SerializedName(\"id\")\n public Long _id;\n}\n","subject":"Add doc for id field for data entity"} {"old_contents":"package com.github.aureliano.achmed.os.service;\n\nimport com.github.aureliano.achmed.resources.properties.ServiceProperties;\n\npublic abstract class BaseService implements IService {\n\n\tprivate ServiceProperties properties;\n\t\n\tpublic BaseService() {\n\t\tsuper();\n\t}\n\n\tpublic void setServiceProperties(ServiceProperties properties) {\n\t\tthis.properties = properties;\n\t}\n\n\tpublic ServiceProperties getServiceProperties() {\n\t\treturn this.properties;\n\t}\n}","new_contents":"package com.github.aureliano.achmed.os.service;\n\nimport com.github.aureliano.achmed.resources.properties.ServiceProperties;\n\npublic abstract class BaseService implements IService {\n\n\tprotected ServiceProperties properties;\n\t\n\tpublic BaseService() {\n\t\tsuper();\n\t}\n\n\tpublic void setServiceProperties(ServiceProperties properties) {\n\t\tthis.properties = properties;\n\t}\n\n\tpublic ServiceProperties getServiceProperties() {\n\t\treturn this.properties;\n\t}\n}","subject":"Set properties attribute to protect visibility."} {"old_contents":"package mil.nga.giat.mage.sdk.datastore.observation;\n\nimport com.j256.ormlite.field.DatabaseField;\nimport com.j256.ormlite.table.DatabaseTable;\n\nimport java.io.Serializable;\n\nimport mil.nga.giat.mage.sdk.datastore.Property;\n\n@DatabaseTable(tableName = \"observation_properties\")\npublic class ObservationProperty extends Property {\n\n\t@DatabaseField(foreign = true, uniqueCombo = true)\n\tprivate ObservationForm observationForm;\n\n\tpublic ObservationProperty() {\n\t\t\/\/ ORMLite needs a no-arg constructor\n\t}\n\n\tpublic ObservationProperty(String pKey, Serializable pValue) {\n\t\tsuper(pKey, pValue);\n\t}\n\n\tpublic ObservationForm getObservation() {\n\t\treturn observationForm;\n\t}\n\n\tpublic void setObservationForm(ObservationForm observationForm) {\n\t\tthis.observationForm = observationForm;\n\t}\n\n}\n","new_contents":"package mil.nga.giat.mage.sdk.datastore.observation;\n\nimport com.j256.ormlite.field.DatabaseField;\nimport com.j256.ormlite.table.DatabaseTable;\n\nimport org.apache.commons.lang3.StringUtils;\n\nimport java.io.Serializable;\nimport java.util.ArrayList;\n\nimport mil.nga.giat.mage.sdk.datastore.Property;\n\n@DatabaseTable(tableName = \"observation_properties\")\npublic class ObservationProperty extends Property {\n\n\t@DatabaseField(foreign = true, uniqueCombo = true)\n\tprivate ObservationForm observationForm;\n\n\tpublic ObservationProperty() {\n\t\t\/\/ ORMLite needs a no-arg constructor\n\t}\n\n\tpublic ObservationProperty(String pKey, Serializable pValue) {\n\t\tsuper(pKey, pValue);\n\t}\n\n\tpublic ObservationForm getObservation() {\n\t\treturn observationForm;\n\t}\n\n\tpublic void setObservationForm(ObservationForm observationForm) {\n\t\tthis.observationForm = observationForm;\n\t}\n\n\tpublic boolean isEmpty() {\n\t\tSerializable value = getValue();\n\t\tif (value instanceof String) {\n\t\t\treturn StringUtils.isBlank(value.toString());\n\t\t} else if (value instanceof ArrayList) {\n\t\t\treturn ((ArrayList) value).size() == 0;\n\t\t} else {\n\t\t\treturn value != null;\n\t\t}\n\t}\n\n}\n","subject":"Add empty check for observation property"} {"old_contents":"\/*\n * Licensed to the University of California, Berkeley under one or more contributor license\n * agreements. See the NOTICE file distributed with this work for additional information regarding\n * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License. You may obtain a\n * copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n *\/\n\npackage tachyon.client;\n\nimport org.junit.Test;\nimport org.junit.Assert;\n\n\/**\n * Tests {@link ClientUtils}.\n *\/\npublic final class ClientUtilsTest {\n\n \/**\n * Tests if output of {@link ClientUtils#getRandomNonNegativeLong()} is non-negative.\n *\/\n @Test\n public void getRandomNonNegativeLongTest() throws Exception {\n Assert.assertTrue(ClientUtils.getRandomNonNegativeLong() > 0);\n }\n\n}\n","new_contents":"\/*\n * Licensed to the University of California, Berkeley under one or more contributor license\n * agreements. See the NOTICE file distributed with this work for additional information regarding\n * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License. You may obtain a\n * copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n *\/\n\npackage tachyon.client;\n\nimport org.junit.Test;\nimport org.junit.Assert;\n\n\/**\n * Tests {@link ClientUtils}.\n *\/\npublic final class ClientUtilsTest {\n \/**\n * Tests if output of {@link ClientUtils#getRandomNonNegativeLong()} is non-negative.\n * Also tests for randomness property.\n *\n *\/\n @Test\n public void getRandomNonNegativeLongTest() throws Exception {\n Assert.assertTrue(ClientUtils.getRandomNonNegativeLong() > 0);\n Assert.assertTrue(ClientUtils.getRandomNonNegativeLong() != ClientUtils.getRandomNonNegativeLong());\n }\n}","subject":"Add additional test for randomness property"} {"old_contents":"package org.folio.okapi.bean;\n\n\/**\n * List of Permissions (and permission sets) belonging to a module. Used as a\n * parameter in the system request to initialize the permission module when a\n * module is being enabled for a tenant.\n *\n * @author heikki\n *\/\npublic class PermissionList {\n String moduleId; \/\/ The module that owns these permissions.\n Permission[] perms;\n\n public PermissionList() {\n }\n\n public PermissionList(String moduleId, Permission[] perms) {\n this.moduleId = moduleId;\n this.perms = perms.clone();\n }\n\n public PermissionList(PermissionList other) {\n this.moduleId = other.moduleId;\n this.perms = other.perms.clone();\n }\n\n public String getModuleId() {\n return moduleId;\n }\n\n public void setModuleId(String moduleId) {\n this.moduleId = moduleId;\n }\n\n public Permission[] getPerms() {\n return perms;\n }\n\n public void setPerms(Permission[] perms) {\n this.perms = perms;\n }\n\n}\n","new_contents":"package org.folio.okapi.bean;\n\n\/**\n * List of Permissions (and permission sets) belonging to a module. Used as a\n * parameter in the system request to initialize the permission module when a\n * module is being enabled for a tenant.\n *\n * @author heikki\n *\/\npublic class PermissionList {\n String moduleId; \/\/ The module that owns these permissions.\n Permission[] perms;\n\n public PermissionList() {\n }\n\n public PermissionList(String moduleId, Permission[] perms) {\n this.moduleId = moduleId;\n this.perms = perms;\n }\n\n public PermissionList(PermissionList other) {\n this.moduleId = other.moduleId;\n this.perms = other.perms;\n }\n\n public String getModuleId() {\n return moduleId;\n }\n\n public void setModuleId(String moduleId) {\n this.moduleId = moduleId;\n }\n\n public Permission[] getPerms() {\n return perms;\n }\n\n public void setPerms(Permission[] perms) {\n this.perms = perms;\n }\n\n}\n","subject":"Fix Okapi-301. null ptr when enabling module without permissionSets"} {"old_contents":"package com.aurea.coverage.parser;\n\nimport com.aurea.coverage.CoverageIndex;\nimport com.aurea.coverage.parser.idea.ArchiveHtmlReportParser;\nimport com.aurea.coverage.parser.idea.HtmlReportParser;\n\nimport java.io.InputStream;\nimport java.nio.file.Path;\n\npublic final class IdeaParsers {\n private IdeaParsers() {\n }\n\n public static CoverageIndex fromHtml(Path pathToHtmlReport) {\n return new HtmlReportParser(pathToHtmlReport).buildIndex();\n }\n}\n","new_contents":"package com.aurea.coverage.parser;\n\nimport com.aurea.coverage.CoverageIndex;\nimport com.aurea.coverage.parser.idea.HtmlReportParser;\n\nimport java.nio.file.Path;\n\npublic final class IdeaParsers {\n private IdeaParsers() {\n }\n\n public static CoverageIndex fromHtml(Path pathToHtmlReport) {\n return new HtmlReportParser(pathToHtmlReport).buildIndex();\n }\n}\n","subject":"Archive html is unsupported so far"} {"old_contents":"package magic.compiler;\n\nimport org.junit.Test;\nimport org.objectweb.asm.ClassWriter;\nimport org.objectweb.asm.Opcodes;\n\nimport static org.junit.Assert.*;\nimport static org.objectweb.asm.ClassWriter.*;\n\npublic class TestASM {\n\n\tMyClassLoader cl=new MyClassLoader() ;\n\t\n\tprivate static final class MyClassLoader extends ClassLoader {\n\t\t\n\t\tpublic Class define(byte[] bcode) {\n\t\t\treturn defineClass(null,bcode, 0, bcode.length);\n\t\t}\n\t};\n\t\n\t@Test public void testClassCreation() {\n\t\tClassWriter cw = new ClassWriter(COMPUTE_FRAMES);\n\t\tcw.visit(52,\n\t\t\t\tOpcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, \/\/ access\n\t\t\t\t\"magic\/Test\", \/\/ classname\n\t\t\t\tnull, \/\/ signature, not needed unless generic?\n\t\t\t \"java\/lang\/Object\", \/\/ superclass\n\t\t\t new String[] {} \/\/ interfaces\n\t\t);\n\t\t\n\t\tcw.visitEnd();\n\t\t\n\t\tbyte[] bcode=cw.toByteArray();\n\t\t\n\t\tClass klass=cl.define(bcode);\n\t\t\n\t\tassertNotNull(klass);\n\t}\n}\n","new_contents":"package magic.compiler;\n\nimport static org.junit.Assert.assertNotNull;\nimport static org.objectweb.asm.ClassWriter.COMPUTE_FRAMES;\n\nimport org.junit.Test;\nimport org.objectweb.asm.ClassWriter;\nimport org.objectweb.asm.Opcodes;\nimport org.objectweb.asm.Type;\nimport org.objectweb.asm.commons.GeneratorAdapter;\nimport org.objectweb.asm.commons.Method;\n\npublic class TestASM {\n\n\tMyClassLoader cl = new MyClassLoader();\n\n\tprivate static final class MyClassLoader extends ClassLoader {\n\n\t\tpublic Class define(byte[] bcode) {\n\t\t\treturn defineClass(null, bcode, 0, bcode.length);\n\t\t}\n\t};\n\n\t@Test\n\tpublic void testClassCreation() {\n\t\tClassWriter cw = new ClassWriter(COMPUTE_FRAMES);\n\t\tcw.visit(52, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, \/\/ access\n\t\t\t\t\"magic\/Test\", \/\/ classname\n\t\t\t\tnull, \/\/ signature, not needed unless generic?\n\t\t\t\t\"java\/lang\/Object\", \/\/ superclass\n\t\t\t\tnew String[] {} \/\/ interfaces\n\t\t);\n\n\t\t\n\t\t{\t\/\/ no-arg constructor\n\t\t\t\tMethod m = Method.getMethod(\"void ()\");\n\t\t\t\tGeneratorAdapter mg = new GeneratorAdapter(Opcodes.ACC_PUBLIC, m, null, null, cw);\n\t\t\t\tmg.loadThis();\n\t\t\t\tmg.invokeConstructor(Type.getType(Object.class), m);\n\t\t\t\tmg.returnValue();\n\t\t\t\tmg.endMethod();\n\t\t}\n\n\t\tcw.visitEnd();\n\n\t\tbyte[] bcode = cw.toByteArray();\n\n\t\tClass klass = cl.define(bcode);\n\n\t\tassertNotNull(klass);\n\n\t\tObject o;\n\t\ttry {\n\t\t\to = klass.newInstance();\n\t\t} catch (InstantiationException e) {\n\t\t\tthrow new Error(e);\n\t\t} catch (IllegalAccessException e) {\n\t\t\tthrow new Error(e);\n\t\t}\n\t\tassertNotNull(o);\n\t}\n}\n","subject":"Improve ASM example with default constructor"} {"old_contents":"package classpackage;\n\nimport java.sql.*;\n\n\/**\n * Created by axelkvistad on 3\/18\/16.\n *\/\npublic class DBConnector {\n\n private String username = \"thomjos\"; \/\/DataLeser2.lesTekst(\"Brukernavn: \"); \/\/ DataLeser2, se nedenfor\n private String password = \"cinPn2AK\";\n private String databaseName = \"jdbc:mysql:\/\/mysql.stud.iie.ntnu.no:3306\/\" + username + \"?user=\" + username + \"&password=\" + password;\n private String databaseDriver = \"com.mysql.jdbc.Driver\";\n protected static Connection con = null;\n\n public DBConnector() {\n try {\n Class.forName(databaseDriver);\n con = DriverManager.getConnection(databaseName);\n } catch (ClassNotFoundException exc) {\n System.out.println(exc);\n } catch (SQLException exc) {\n System.out.println(exc);\n }\n }\n\n public void closeConnection() {\n try {\n con.close();\n } catch (SQLException exc) {\n System.out.println(exc);\n }\n }\n\n\n}\n","new_contents":"package classpackage;\n\nimport java.sql.*;\n\n\/**\n * Created by axelkvistad on 3\/18\/16.\n *\/\npublic class DBConnector {\n\n private String username = \"thomjos\"; \/\/DataLeser2.lesTekst(\"Brukernavn: \"); \/\/ DataLeser2, se nedenfor\n private String password = \"cinPn2AK\";\n private String databaseName = \"jdbc:mysql:\/\/mysql.stud.iie.ntnu.no:3306\/\" + username + \"?user=\" + username + \"&password=\" + password;\n private String databaseDriver = \"com.mysql.jdbc.Driver\";\n protected static Connection con = null;\n\n public DBConnector() {\n if(con == null) {\n try {\n Class.forName(databaseDriver);\n con = DriverManager.getConnection(databaseName);\n } catch (ClassNotFoundException exc) {\n System.out.println(exc);\n } catch (SQLException exc) {\n System.out.println(exc);\n }\n }\n }\n\n public void closeConnection() {\n try {\n con.close();\n } catch (SQLException exc) {\n System.out.println(exc);\n }\n }\n\n\n}\n","subject":"Fix so it doesn't create new connection if one has already been created."} {"old_contents":"package in.testpress.testpress.events;\n\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.telephony.SmsMessage;\n\nimport in.testpress.testpress.R;\nimport in.testpress.testpress.authenticator.CodeVerificationActivity.Timer;\nimport in.testpress.testpress.core.Constants;\n\npublic class SmsReceivingEvent extends BroadcastReceiver {\n public String code;\n private Timer timer;\n public SmsReceivingEvent(Timer timer) {\n this.timer = timer;\n }\n\n @Override\n public void onReceive(Context context, Intent intent) {\n \/\/ Retrieves a map of extended data from the intent.\n final Bundle bundle = intent.getExtras();\n try {\n if (bundle != null) {\n final Object[] pdusObj = (Object[]) bundle.get(\"pdus\");\n SmsMessage currentMessage = SmsMessage.createFromPdu((byte[]) pdusObj[0]);\n String senderNum = currentMessage.getDisplayOriginatingAddress();\n if (senderNum.matches(\".*TSTPRS\")) { \/\/check whether TSTPRS present in senderAddress\n String smsContent = currentMessage.getDisplayMessageBody();\n \/\/get the code from smsContent\n code = smsContent.replaceAll(\".*(?<=Thank you for registering at +\"+Constants.Http.URL_BASE +\"+. Your authorization code is )([^\\n]*)(?=.).*\", \"$1\");\n timer.cancel();\n timer.onFinish();\n }\n } \/\/ bundle is null\n } catch (Exception e) {\n timer.cancel();\n timer.onFinish();\n }\n }\n}\n\n","new_contents":"package in.testpress.testpress.events;\n\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.telephony.SmsMessage;\n\nimport in.testpress.testpress.authenticator.CodeVerificationActivity.Timer;\n\npublic class SmsReceivingEvent extends BroadcastReceiver {\n public String code;\n private Timer timer;\n public SmsReceivingEvent(Timer timer) {\n this.timer = timer;\n }\n\n @Override\n public void onReceive(Context context, Intent intent) {\n \/\/ Retrieves a map of extended data from the intent.\n final Bundle bundle = intent.getExtras();\n try {\n if (bundle != null) {\n final Object[] pdusObj = (Object[]) bundle.get(\"pdus\");\n SmsMessage currentMessage = SmsMessage.createFromPdu((byte[]) pdusObj[0]);\n String senderNum = currentMessage.getDisplayOriginatingAddress();\n if (senderNum.matches(\".*TSTPRS\")) { \/\/check whether TSTPRS present in senderAddress\n String smsContent = currentMessage.getDisplayMessageBody();\n \/\/get the code from smsContent\n code = smsContent.replaceAll(\".*(?=.*)(?<=Your authorization code is )([^\\n]*)(?=.).*\", \"$1\");\n timer.cancel();\n timer.onFinish();\n }\n } \/\/ bundle is null\n } catch (Exception e) {\n timer.cancel();\n timer.onFinish();\n }\n }\n}\n\n","subject":"Modify sms format in sms receiving event"} {"old_contents":"package database.neo4j;\n\nimport org.neo4j.graphdb.RelationshipType;\n\n\/**\n * JDrive\n * Created by David Maignan on 15-08-21.\n *\/\npublic enum RelTypes implements RelationshipType {\n PARENT\n}\n","new_contents":"package database.neo4j;\n\nimport org.neo4j.graphdb.RelationshipType;\n\n\/**\n * JDrive\n * Created by David Maignan on 15-08-21.\n *\/\npublic enum RelTypes implements RelationshipType {\n PARENT, CHANGE\n}\n","subject":"Add change type relation for neo4j"} {"old_contents":"package edu.usc.glidein.util;\n\nimport java.io.IOException;\n\nimport sun.misc.BASE64Encoder;\nimport sun.misc.BASE64Decoder;\n\n\/**\n * Convert to\/from Base64-encoded data\n *\n * @author Gideon Juve \n *\/\npublic class Base64\n{\n\t\n\t\/**\n\t * Base64-encode a string\n\t * @param string The string to encode\n\t * @return The base64 encoding of the string\n\t *\/\n\tpublic static String toBase64(String string)\n\t{\n\t\tif(string==null) return null;\n\t\tbyte[] buff = string.getBytes();\n\t\treturn new BASE64Encoder().encode(buff);\n\t}\n\t\n\t\/**\n\t * Decode a base64-encoded string\n\t * @param base64 Base64-encoded string\n\t * @return The decoded string\n\t *\/\n\tpublic static String fromBase64(String base64)\n\t{\n\t\tif(base64==null) return null;\n\t\t\n\t\ttry {\n\t\t\tbyte[] output = new BASE64Decoder().decodeBuffer(base64);\n\t\t\treturn new String(output);\n\t\t} \n\t\tcatch(IOException ioe) {\n\t\t\treturn null; \/* I don't think this will actually happen *\/\n\t\t}\n\t}\n\n\tpublic static void main(String[] args)\n\t{\n\t\tSystem.out.println(new String(Base64.toBase64(\"Hello, World!\")));\n\t\tSystem.out.println(Base64.fromBase64(\"SGVsbG8sIFdvcmxkIQ==\"));\n\t}\n}\n","new_contents":"package edu.usc.glidein.util;\n\nimport java.io.IOException;\n\nimport sun.misc.BASE64Encoder;\nimport sun.misc.BASE64Decoder;\n\n\/**\n * Convert to\/from Base64-encoded data\n *\n * @author Gideon Juve \n *\/\npublic class Base64\n{\n\t\n\t\/**\n\t * Base64-encode a string\n\t * @param string The string to encode\n\t * @return The base64 encoding of the string\n\t *\/\n\tpublic static byte[] toBase64(String string)\n\t{\n\t\tif(string==null) return null;\n\t\tbyte[] buff = string.getBytes();\n\t\tString s = new BASE64Encoder().encode(buff);\n\t\treturn s.getBytes();\n\t}\n\t\n\t\/**\n\t * Decode a base64-encoded string\n\t * @param base64 Base64-encoded binary\n\t * @return The decoded string\n\t *\/\n\tpublic static String fromBase64(byte[] base64)\n\t{\n\t\tif(base64==null) return null;\n\t\t\n\t\ttry {\n\t\t\tString s = new String(base64);\n\t\t\tbyte[] output = new BASE64Decoder().decodeBuffer(s);\n\t\t\treturn new String(output);\n\t\t} \n\t\tcatch(IOException ioe) {\n\t\t\treturn null; \/* I don't think this will actually happen *\/\n\t\t}\n\t}\n}\n","subject":"Use bytes for base-64 encoded data instead of strings"} {"old_contents":"package com.ychstudio.screens.transitions;\n\nimport com.badlogic.gdx.Gdx;\nimport com.badlogic.gdx.graphics.Texture;\nimport com.badlogic.gdx.graphics.g2d.Sprite;\nimport com.badlogic.gdx.graphics.g2d.SpriteBatch;\nimport com.badlogic.gdx.math.Interpolation;\n\npublic class SlideLeftTransition implements ScreenTransition {\n \n private float duration;\n \n public SlideLeftTransition(float duration) {\n this.duration = duration;\n }\n\n @Override\n public float getDuration() {\n return duration;\n }\n\n @Override\n public void rander(SpriteBatch batch, Texture currentScreenTexture, Texture nextScreenTexture, float alpha) {\n float w = Gdx.graphics.getWidth();\n alpha = Interpolation.fade.apply(alpha);\n \n Sprite currentSprite = new Sprite(currentScreenTexture);\n currentSprite.flip(false, true);\n currentSprite.setPosition(w * alpha, 0);\n Sprite nextSprite = new Sprite(nextScreenTexture);\n nextSprite.flip(false, true);\n nextSprite.setPosition(-w + w * alpha, 0);\n \n batch.begin();\n currentSprite.draw(batch);\n nextSprite.draw(batch);\n batch.end();\n }\n\n}\n","new_contents":"package com.ychstudio.screens.transitions;\n\nimport com.badlogic.gdx.Gdx;\nimport com.badlogic.gdx.graphics.Texture;\nimport com.badlogic.gdx.graphics.g2d.SpriteBatch;\nimport com.badlogic.gdx.math.Interpolation;\n\npublic class SlideLeftTransition implements ScreenTransition {\n \n private float duration;\n \n public SlideLeftTransition(float duration) {\n this.duration = duration;\n }\n\n @Override\n public float getDuration() {\n return duration;\n }\n\n @Override\n public void rander(SpriteBatch batch, Texture currentScreenTexture, Texture nextScreenTexture, float alpha) {\n float w = Gdx.graphics.getWidth();\n alpha = Interpolation.fade.apply(alpha);\n \n batch.begin();\n batch.draw(currentScreenTexture, w * alpha, 0, w, currentScreenTexture.getHeight(), 0, 0, (int)w, currentScreenTexture.getHeight(), false, true);\n batch.draw(nextScreenTexture, -w + w * alpha, 0, w, nextScreenTexture.getHeight(), 0, 0, (int)w, nextScreenTexture.getHeight(), false, true);\n batch.end();\n }\n\n}\n","subject":"Improve transition by using batch.draw directly without creating Sprites"} {"old_contents":"package io.github.jakriz.derrick.example;\n\nimport io.github.jakriz.derrick.annotation.DerrickInterface;\nimport io.github.jakriz.derrick.annotation.SourceFrom;\n\n@DerrickInterface(baseUrl = \"https:\/\/github.com\/jakriz\/derrick\", imports = {\"io.github.jakriz.derrick.example.*\"})\npublic interface DocsMethods {\n\n @SourceFrom(selector = \"#sample-math-wizard-add\", addReturn = true)\n int add(MathWizard mathWizard);\n\n}\n","new_contents":"package io.github.jakriz.derrick.example;\n\nimport io.github.jakriz.derrick.annotation.DerrickInterface;\nimport io.github.jakriz.derrick.annotation.SourceFrom;\n\n@DerrickInterface(baseUrl = \"https:\/\/github.com\/jakriz\/derrick\", imports = {\"io.github.jakriz.derrick.example.*\"})\npublic interface DocsMethods {\n\n @SourceFrom(selector = \"#user-content-sample-math-wizard-add\", addReturn = true)\n int add(MathWizard mathWizard);\n\n}\n","subject":"Change example id to fit github's naming"} {"old_contents":"package se.citerus.dddsample.domain;\n\nimport org.apache.commons.lang.Validate;\nimport org.apache.commons.lang.builder.EqualsBuilder;\nimport org.apache.commons.lang.builder.HashCodeBuilder;\n\n\/**\n * Identifies a particular cargo.\n * \n * Make sure to put a constraint in the database to make sure TrackingId is unique.\n *\/\npublic final class TrackingId {\n\n private String id;\n\n \/**\n * Constructor.\n *\n * @param id Id string.\n *\/\n public TrackingId(final String id) {\n Validate.notNull(id);\n this.id = id;\n }\n\n \/**\n * @return String representation of this tracking id.\n *\/\n public String idString() {\n return id;\n }\n\n @Override\n public boolean equals(final Object obj) {\n return EqualsBuilder.reflectionEquals(this, obj);\n }\n\n @Override\n public int hashCode() {\n return HashCodeBuilder.reflectionHashCode(this);\n }\n\n\n TrackingId() {\n \/\/ Needed by Hibernate\n }\n\n}\n","new_contents":"package se.citerus.dddsample.domain;\n\nimport org.apache.commons.lang.Validate;\nimport org.apache.commons.lang.builder.EqualsBuilder;\nimport org.apache.commons.lang.builder.HashCodeBuilder;\n\n\/**\n * Uniquely identifies a particular cargo. Automatically generated by the application.\n * \n *\/\npublic final class TrackingId implements ValueObject {\n\n private String id;\n\n \/**\n * Constructor.\n *\n * @param id Id string.\n *\/\n public TrackingId(final String id) {\n Validate.notNull(id);\n this.id = id;\n }\n\n \/**\n * @return String representation of this tracking id.\n *\/\n public String idString() {\n return id;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n TrackingId other = (TrackingId) o;\n\n return sameValueAs(other);\n }\n\n @Override\n public int hashCode() {\n return HashCodeBuilder.reflectionHashCode(this);\n }\n\n public boolean sameValueAs(TrackingId other) {\n return other != null && EqualsBuilder.reflectionEquals(this, other);\n }\n\n TrackingId() {\n \/\/ Needed by Hibernate\n }\n}\n","subject":"Implement ValueObject.sameValueAs(), and use that as delegate in equals()"} {"old_contents":"package info.u_team.u_team_test.enchantment;\n\nimport info.u_team.u_team_core.enchantment.UEnchantment;\nimport net.minecraft.enchantment.EnchantmentType;\nimport net.minecraft.inventory.EquipmentSlotType;\n\npublic class AutoSmeltEnchantment extends UEnchantment {\n\t\n\tpublic AutoSmeltEnchantment(String name) {\n\t\tsuper(name, Rarity.COMMON, EnchantmentType.DIGGER, new EquipmentSlotType[] { EquipmentSlotType.MAINHAND });\n\t}\n}\n","new_contents":"package info.u_team.u_team_test.enchantment;\n\nimport net.minecraft.enchantment.*;\nimport net.minecraft.inventory.EquipmentSlotType;\n\npublic class AutoSmeltEnchantment extends Enchantment {\n\t\n\tpublic AutoSmeltEnchantment() {\n\t\tsuper(Rarity.COMMON, EnchantmentType.DIGGER, new EquipmentSlotType[] { EquipmentSlotType.MAINHAND });\n\t}\n}\n","subject":"Remove UEnchantment as its not unnessessary for the autosmelt enchantment using the deferred register"} {"old_contents":"package io.particle.android.sdk;\n\nimport android.app.Application;\n\nimport com.segment.analytics.Analytics;\nimport com.segment.analytics.android.integrations.firebase.FirebaseIntegration;\nimport com.segment.analytics.android.integrations.intercom.IntercomIntegration;\n\n\npublic class ReleaseBuildAppInitializer {\n\n public static void onApplicationCreated(Application app) {\n String fakeKey = \"lolnope12345\"; \/\/ FIXME: use real key\n Analytics.setSingletonInstance(new Analytics.Builder(app, fakeKey)\n .use(FirebaseIntegration.FACTORY)\n .use(IntercomIntegration.FACTORY)\n .build()\n );\n }\n\n}\n","new_contents":"package io.particle.android.sdk;\n\nimport android.app.Application;\n\nimport com.segment.analytics.Analytics;\nimport com.segment.analytics.android.integrations.firebase.FirebaseIntegration;\nimport com.segment.analytics.android.integrations.intercom.IntercomIntegration;\n\n\npublic class ReleaseBuildAppInitializer {\n\n public static void onApplicationCreated(Application app) {\n\/\/ String fakeKey = \"lolnope12345\"; \/\/ FIXME: use real key\n \/\/ Disable, even in prod, until we have the key\n\/\/ Analytics.setSingletonInstance(new Analytics.Builder(app, fakeKey)\n\/\/ .use(FirebaseIntegration.FACTORY)\n\/\/ .use(IntercomIntegration.FACTORY)\n\/\/ .build()\n\/\/ );\n }\n\n}\n","subject":"Disable Segment entirely for now"} {"old_contents":"package gr8pefish.openglider.common.event;\n\nimport gr8pefish.openglider.common.capabilities.OpenGliderCapabilities;\nimport gr8pefish.openglider.common.capabilities.PlayerGlidingCapability;\nimport gr8pefish.openglider.common.lib.ModInfo;\nimport net.minecraft.entity.player.EntityPlayer;\nimport net.minecraft.util.ResourceLocation;\nimport net.minecraftforge.event.AttachCapabilitiesEvent;\nimport net.minecraftforge.fml.common.eventhandler.SubscribeEvent;\n\npublic class ServerEventHandler {\n\n @SubscribeEvent\n public void onAttachCapability(AttachCapabilitiesEvent.Entity event) {\n if (event.getEntity() instanceof EntityPlayer) {\n if (!event.getEntity().hasCapability(OpenGliderCapabilities.GLIDING_CAPABILITY, null)) {\n event.addCapability(new ResourceLocation(ModInfo.MODID + \".\" + ModInfo.GLIDING_CAPABILITY_STRING), new PlayerGlidingCapability());\n }\n }\n }\n}\n","new_contents":"package gr8pefish.openglider.common.event;\n\nimport gr8pefish.openglider.common.capabilities.OpenGliderCapabilities;\nimport gr8pefish.openglider.common.capabilities.PlayerGlidingCapability;\nimport gr8pefish.openglider.common.lib.ModInfo;\nimport net.minecraft.entity.Entity;\nimport net.minecraft.entity.player.EntityPlayer;\nimport net.minecraft.util.ResourceLocation;\nimport net.minecraftforge.event.AttachCapabilitiesEvent;\nimport net.minecraftforge.fml.common.eventhandler.SubscribeEvent;\n\npublic class ServerEventHandler {\n\n @SubscribeEvent\n public void onAttachCapability(AttachCapabilitiesEvent event) {\n if (event.getObject() instanceof EntityPlayer) {\n if (!event.getObject().hasCapability(OpenGliderCapabilities.GLIDING_CAPABILITY, null)) {\n event.addCapability(new ResourceLocation(ModInfo.MODID + \".\" + ModInfo.GLIDING_CAPABILITY_STRING), new PlayerGlidingCapability());\n }\n }\n }\n}\n","subject":"Update capability attach event to non-deprecated call"} {"old_contents":"\/*------------------------------------------------------------------------------\n Copyright (c) CovertJaguar, 2011-2016\n\n This work (the API) is licensed under the \"MIT\" License,\n see LICENSE.md for details.\n -----------------------------------------------------------------------------*\/\n\npackage mods.railcraft.api.crafting;\n\nimport net.minecraft.item.ItemStack;\nimport net.minecraftforge.fluids.FluidStack;\n\nimport javax.annotation.Nullable;\nimport java.util.List;\n\n\/**\n *\n * @author CovertJaguar \n *\/\npublic interface ICokeOvenCraftingManager {\n\n void addRecipe(ItemStack input, boolean matchDamage, boolean matchNBT, ItemStack output, FluidStack liquidOutput, int cookTime);\n\n @Nullable\n ICokeOvenRecipe getRecipe(ItemStack stack);\n\n List getRecipes();\n}\n","new_contents":"\/*------------------------------------------------------------------------------\n Copyright (c) CovertJaguar, 2011-2016\n\n This work (the API) is licensed under the \"MIT\" License,\n see LICENSE.md for details.\n -----------------------------------------------------------------------------*\/\n\npackage mods.railcraft.api.crafting;\n\nimport net.minecraft.item.ItemStack;\nimport net.minecraftforge.fluids.FluidStack;\n\nimport javax.annotation.Nullable;\nimport java.util.List;\n\n\/**\n *\n * @author CovertJaguar \n *\/\npublic interface ICokeOvenCraftingManager {\n\n void addRecipe(ItemStack input, boolean matchDamage, boolean matchNBT, ItemStack output, @Nullable FluidStack liquidOutput, int cookTime);\n\n @Nullable\n ICokeOvenRecipe getRecipe(ItemStack stack);\n\n List getRecipes();\n}\n","subject":"Add a nullable to fluid stack"} {"old_contents":"package org.jboss.da.rest.reports.model;\n\nimport org.jboss.da.communication.aprox.model.GAV;\nimport lombok.Getter;\nimport lombok.NonNull;\nimport lombok.RequiredArgsConstructor;\nimport lombok.Setter;\n\n@RequiredArgsConstructor\npublic class LookupReport {\n\n @Getter\n @Setter\n @NonNull\n private GAV gav;\n\n @Getter\n @Setter\n @NonNull\n private String bestMatchVersion;\n\n}\n","new_contents":"package org.jboss.da.rest.reports.model;\n\nimport org.jboss.da.communication.aprox.model.GAV;\nimport lombok.Getter;\nimport lombok.NonNull;\nimport lombok.AllArgsConstructor;\nimport lombok.Setter;\n\n@AllArgsConstructor\npublic class LookupReport {\n\n @Getter\n @Setter\n @NonNull\n private GAV gav;\n\n @Getter\n @Setter\n private String bestMatchVersion;\n\n}\n","subject":"Allow `bestMatchVersion` to be null"} {"old_contents":"package util;\n\nimport com.google.appengine.api.users.User;\nimport com.google.appengine.api.users.UserService;\nimport com.google.appengine.api.users.UserServiceFactory;\n\npublic class UserAuthUtil {\n \/**\n * Returns a boolean for the user's login status\n * @return user login status\n *\/\n public static boolean isUserLoggedIn() {\n UserService userServ = UserServiceFactory.getUserService();\n return userServ.isUserLoggedIn();\n }\n\n \/**\n * @param redirect URL for webpage to return to after login\n * @return\n *\/\n public static String getLoginURL(String redirect) {\n UserService userServ = UserServiceFactory.getUserService();\n return userServ.createLoginURL(redirect);\n }\n public static String getLogoutURL(String redirect) {\n return UserServiceFactory.getUserService().createLogoutURL(redirect);\n }\n public static User getUser() {\n return UserServiceFactory.getUserService().getCurrentUser();\n }\n public static boolean isUserAuthorized() {\n return getDomainName().equals(\"google.com\");\n }\n\n private static String getDomainName() {\n String email = getUser().getEmail();\n return email.substring(email.indexOf('@') + 1);\n }\n}","new_contents":"package util;\n\nimport com.google.appengine.api.users.User;\nimport com.google.appengine.api.users.UserService;\nimport com.google.appengine.api.users.UserServiceFactory;\n\npublic class UserAuthUtil {\n \/**\n * Returns a boolean for the user's login status\n * @return user login status\n *\/\n public static boolean isUserLoggedIn() {\n UserService userServ = UserServiceFactory.getUserService();\n return userServ.isUserLoggedIn();\n }\n\n \/**\n * @param redirect URL for webpage to return to after login\n * @return URL for user to click to login\n *\/\n public static String getLoginURL(String redirect) {\n UserService userServ = UserServiceFactory.getUserService();\n return userServ.createLoginURL(redirect);\n }\n\n \/**\n * @param redirect URL for webpage to return to after logout\n * @return URL for user to click to logout\n *\/\n public static String getLogoutURL(String redirect) {\n return UserServiceFactory.getUserService().createLogoutURL(redirect);\n }\n\n \/**\n * Helper method to return a User object\n *\/\n public static User getUser() {\n return UserServiceFactory.getUserService().getCurrentUser();\n }\n\n \/**\n * Determines whether a user is authorized to use the requested resource\n * @return true when the user's email domain is \"google.com\"\n *\/\n public static boolean isUserAuthorized() {\n return getDomainName().equals(\"google.com\");\n }\n\n \/**\n * @return domain name from a user's email address\n *\/\n private static String getDomainName() {\n String email = getUser().getEmail();\n return email.substring(email.indexOf('@') + 1);\n }\n}","subject":"Add javadoc for authentication utility"} {"old_contents":"\/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage eu.agilejava.mvc.prg;\n\nimport java.io.Serializable;\nimport java.util.ArrayList;\nimport java.util.List;\nimport javax.inject.Named;\nimport javax.mvc.annotation.RedirectScoped;\n\n\/**\n * @author Ivar Grimstad (ivar.grimstad@gmail.com)\n *\/\n@Named\n@RedirectScoped\npublic class Messages implements Serializable {\n\n private static final long serialVersionUID = 601263646224546642L;\n\n private List errors = new ArrayList();\n\n public List getErrors() {\n return errors;\n }\n\n public void setErrors(List messages) {\n this.errors = messages;\n }\n}\n","new_contents":"\/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage eu.agilejava.mvc.prg;\n\nimport java.io.Serializable;\nimport java.util.ArrayList;\nimport java.util.List;\nimport javax.enterprise.context.RequestScoped;\nimport javax.inject.Named;\nimport javax.mvc.annotation.RedirectScoped;\n\n\/**\n * @author Ivar Grimstad (ivar.grimstad@gmail.com)\n *\/\n@Named\n@RequestScoped\npublic class Messages implements Serializable {\n\n private static final long serialVersionUID = 601263646224546642L;\n\n private List errors = new ArrayList();\n\n public List getErrors() {\n return errors;\n }\n\n public void setErrors(List messages) {\n this.errors = messages;\n }\n}\n","subject":"Refactor and clean up for demo"} {"old_contents":"package com.elmakers.mine.bukkit.api.spell;\n\nimport java.util.Collection;\n\nimport org.bukkit.Color;\nimport org.bukkit.command.CommandSender;\nimport org.bukkit.configuration.ConfigurationSection;\n\nimport com.elmakers.mine.bukkit.api.block.MaterialAndData;\nimport com.elmakers.mine.bukkit.api.effect.EffectPlayer;\n\n\/**\n * A Spell template, as defined in the spells configuration files.\n *\/\npublic interface SpellTemplate extends Comparable, CostReducer {\n public String getName();\n public String getAlias();\n public String getDescription();\n public String getExtendedDescription();\n public String getKey();\n public Color getColor();\n public long getWorth();\n public SpellCategory getCategory();\n public long getCastCount();\n public String getUsage();\n public MaterialAndData getIcon();\n public boolean hasIcon();\n public boolean hasCastPermission(CommandSender sender);\n public Collection getCosts();\n public Collection getActiveCosts();\n public Collection getEffects(SpellResult result);\n public Collection getEffects(String effectsKey);\n public void getParameters(Collection parameters);\n public void getParameterOptions(Collection examples, String parameterKey);\n public long getDuration();\n public long getCooldown();\n public Spell createSpell();\n public void loadTemplate(String key, ConfigurationSection node);\n public String getPermissionNode();\n}\n","new_contents":"package com.elmakers.mine.bukkit.api.spell;\n\nimport java.util.Collection;\n\nimport org.bukkit.Color;\nimport org.bukkit.command.CommandSender;\nimport org.bukkit.configuration.ConfigurationSection;\n\nimport com.elmakers.mine.bukkit.api.block.MaterialAndData;\nimport com.elmakers.mine.bukkit.api.effect.EffectPlayer;\n\n\/**\n * A Spell template, as defined in the spells configuration files.\n *\/\npublic interface SpellTemplate extends Comparable, CostReducer {\n public String getName();\n public String getAlias();\n public String getDescription();\n public String getExtendedDescription();\n public String getKey();\n public Color getColor();\n public long getWorth();\n public SpellCategory getCategory();\n public long getCastCount();\n public String getUsage();\n public MaterialAndData getIcon();\n public boolean hasIcon();\n public boolean hasCastPermission(CommandSender sender);\n public Collection getCosts();\n public Collection getActiveCosts();\n public Collection getEffects(SpellResult result);\n public Collection getEffects(String effectsKey);\n public void getParameters(Collection parameters);\n public void getParameterOptions(Collection examples, String parameterKey);\n public long getDuration();\n public long getCooldown();\n public Spell createSpell();\n public void loadTemplate(String key, ConfigurationSection node);\n public String getPermissionNode();\n public boolean isHidden();\n}\n","subject":"Add API access to a Spell's hidden flag"} {"old_contents":"package org.commcare.core.network;\n\n\nimport java.util.List;\nimport java.util.Map;\n\nimport okhttp3.MultipartBody;\nimport okhttp3.RequestBody;\nimport okhttp3.ResponseBody;\nimport retrofit2.Call;\nimport retrofit2.http.Body;\nimport retrofit2.http.GET;\nimport retrofit2.http.HeaderMap;\nimport retrofit2.http.Multipart;\nimport retrofit2.http.POST;\nimport retrofit2.http.Part;\nimport retrofit2.http.QueryMap;\nimport retrofit2.http.Streaming;\nimport retrofit2.http.Url;\n\npublic interface CommCareNetworkService {\n\n @Streaming\n @GET\n Call makeGetRequest(@Url String url, @QueryMap Map params,\n @HeaderMap Map headers);\n\n @Streaming\n @Multipart\n @POST\n Call makeMultipartPostRequest(@Url String url, @QueryMap Map params,\n @HeaderMap Map headers,\n @Part List files);\n\n @Streaming\n @POST\n Call makePostRequest(@Url String url, @QueryMap Map params,\n @HeaderMap Map headers,\n @Body RequestBody body);\n}\n","new_contents":"package org.commcare.core.network;\n\n\nimport java.util.List;\nimport java.util.Map;\n\nimport okhttp3.MultipartBody;\nimport okhttp3.RequestBody;\nimport okhttp3.ResponseBody;\nimport retrofit2.Call;\nimport retrofit2.http.Body;\nimport retrofit2.http.GET;\nimport retrofit2.http.HeaderMap;\nimport retrofit2.http.Multipart;\nimport retrofit2.http.POST;\nimport retrofit2.http.PUT;\nimport retrofit2.http.Part;\nimport retrofit2.http.QueryMap;\nimport retrofit2.http.Streaming;\nimport retrofit2.http.Url;\n\npublic interface CommCareNetworkService {\n\n @Streaming\n @GET\n Call makeGetRequest(@Url String url, @QueryMap Map params,\n @HeaderMap Map headers);\n\n @Streaming\n @Multipart\n @POST\n Call makeMultipartPostRequest(@Url String url, @QueryMap Map params,\n @HeaderMap Map headers,\n @Part List files);\n\n @Streaming\n @POST\n Call makePostRequest(@Url String url, @QueryMap Map params,\n @HeaderMap Map headers,\n @Body RequestBody body);\n\n @PUT\n Call makePutRequest(@Url String url, @Body RequestBody body);\n}\n","subject":"Add PUT method to retrofit server"} {"old_contents":"package me.jaxbot.wear.preconditioningleaf;\n\nimport android.app.Notification;\nimport android.app.NotificationManager;\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.IBinder;\nimport android.util.Log;\n\npublic class StartACService extends Service {\n private final static String TAG = \"StartACService\";\n public StartACService() {\n }\n\n @Override\n public IBinder onBind(Intent intent) {\n \/\/ TODO: Return the communication channel to the service.\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }\n\n @Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n Log.i(TAG, \"Started service.\");\n\n String eventName;\n eventName = intent.getStringExtra(\"eventName\");\n\n Notification.Builder mBuilder =\n new Notification.Builder(this)\n .setSmallIcon(R.drawable.ic_leaf_notification)\n .setContentTitle(\"Starting AC for \" + eventName);\n\n NotificationManager mNotificationManager = (NotificationManager)\n getSystemService(NOTIFICATION_SERVICE);\n mNotificationManager.notify(2, mBuilder.build());\n return super.onStartCommand(intent, flags, startId);\n }\n}\n","new_contents":"package me.jaxbot.wear.preconditioningleaf;\n\nimport android.app.Notification;\nimport android.app.NotificationManager;\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.IBinder;\nimport android.util.Log;\n\npublic class StartACService extends Service {\n private final static String TAG = \"StartACService\";\n public StartACService() {\n }\n\n @Override\n public IBinder onBind(Intent intent) {\n \/\/ TODO: Return the communication channel to the service.\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }\n\n @Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n Log.i(TAG, \"Started service.\");\n\n \/\/ Start_Sticky command, or other action without intent\n if (intent == null)\n return super.onStartCommand(intent, flags, startId);\n\n String eventName;\n eventName = intent.getStringExtra(\"eventName\");\n\n Notification.Builder mBuilder =\n new Notification.Builder(this)\n .setSmallIcon(R.drawable.ic_leaf_notification)\n .setContentTitle(\"Starting AC for \" + eventName);\n\n NotificationManager mNotificationManager = (NotificationManager)\n getSystemService(NOTIFICATION_SERVICE);\n mNotificationManager.notify(2, mBuilder.build());\n\n return super.onStartCommand(intent, flags, startId);\n }\n}\n","subject":"Fix crashing when starting service"} {"old_contents":"package io.atomix.atomix.testing;\n\nimport java.util.Map;\nimport java.util.concurrent.ConcurrentHashMap;\n\nimport org.slf4j.LoggerFactory;\nimport org.testng.IClass;\nimport org.testng.IInvokedMethod;\nimport org.testng.IInvokedMethodListener;\nimport org.testng.ITestNGMethod;\nimport org.testng.ITestResult;\n\npublic class TestCaseLogger implements IInvokedMethodListener {\n private static final Map START_TIMES = new ConcurrentHashMap<>();\n\n public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {\n if (!method.isTestMethod())\n return;\n\n ITestNGMethod testMethod = method.getTestMethod();\n IClass clazz = testMethod.getTestClass();\n\n START_TIMES.put(testMethod, System.currentTimeMillis());\n LoggerFactory.getLogger(\"BEFORE\").info(\"{}.{}\", clazz.getRealClass().getName(), testMethod.getMethodName());\n }\n\n public void afterInvocation(IInvokedMethod method, ITestResult testResult) {\n if (!method.isTestMethod())\n return;\n\n ITestNGMethod testMethod = method.getTestMethod();\n IClass clazz = testMethod.getTestClass();\n double elapsed = (System.currentTimeMillis() - START_TIMES.remove(testMethod)) \/ 1000.0;\n\n if (elapsed > 1)\n LoggerFactory.getLogger(\"AFTER\").info(\"{}.{} Ran for {} seconds\", clazz.getRealClass().getName(),\n testMethod.getMethodName(), elapsed);\n }\n}","new_contents":"package io.atomix.atomix.testing;\n\nimport java.util.Map;\nimport java.util.concurrent.ConcurrentHashMap;\n\nimport org.slf4j.LoggerFactory;\nimport org.testng.IClass;\nimport org.testng.IInvokedMethod;\nimport org.testng.IInvokedMethodListener;\nimport org.testng.ITestNGMethod;\nimport org.testng.ITestResult;\n\npublic class TestCaseLogger implements IInvokedMethodListener {\n private static final Map START_TIMES = new ConcurrentHashMap<>();\n\n public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {\n if (!method.isTestMethod())\n return;\n\n ITestNGMethod testMethod = method.getTestMethod();\n IClass clazz = testMethod.getTestClass();\n\n START_TIMES.put(testMethod, System.currentTimeMillis());\n LoggerFactory.getLogger(\"BEFORE\").info(\"{}#{}\", clazz.getRealClass().getName(), testMethod.getMethodName());\n }\n\n public void afterInvocation(IInvokedMethod method, ITestResult testResult) {\n if (!method.isTestMethod())\n return;\n\n ITestNGMethod testMethod = method.getTestMethod();\n IClass clazz = testMethod.getTestClass();\n double elapsed = (System.currentTimeMillis() - START_TIMES.remove(testMethod)) \/ 1000.0;\n\n if (elapsed > 1)\n LoggerFactory.getLogger(\"AFTER\").info(\"{}#{} Ran for {} seconds\", clazz.getRealClass().getName(),\n testMethod.getMethodName(), elapsed);\n }\n}","subject":"Use surefire compatible test case\/method logging."} {"old_contents":"package ganymedes01.etfuturum.core.handlers;\n\nimport ganymedes01.etfuturum.ModBlocks;\n\nimport java.util.List;\n\nimport net.minecraft.block.Block;\nimport net.minecraft.init.Blocks;\nimport net.minecraft.tileentity.TileEntity;\nimport net.minecraft.world.World;\nimport cpw.mods.fml.common.eventhandler.SubscribeEvent;\nimport cpw.mods.fml.common.gameevent.TickEvent.Phase;\nimport cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;\nimport cpw.mods.fml.relauncher.Side;\n\npublic class WorldTickEventHandler {\n\n\t@SubscribeEvent\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void tick(WorldTickEvent event) {\n\t\tif (event.side != Side.SERVER || event.phase != Phase.START)\n\t\t\treturn;\n\n\t\tWorld world = event.world;\n\t\tfor (TileEntity tile : (List) world.loadedTileEntityList) {\n\t\t\tBlock block = world.getBlock(tile.xCoord, tile.yCoord, tile.zCoord);\n\t\t\tif (block == Blocks.brewing_stand) {\n\t\t\t\tworld.setBlock(tile.xCoord, tile.yCoord, tile.zCoord, ModBlocks.brewing_stand);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}","new_contents":"package ganymedes01.etfuturum.core.handlers;\n\nimport ganymedes01.etfuturum.ModBlocks;\n\nimport java.util.List;\n\nimport net.minecraft.block.Block;\nimport net.minecraft.init.Blocks;\nimport net.minecraft.tileentity.TileEntity;\nimport net.minecraft.world.World;\nimport cpw.mods.fml.common.eventhandler.SubscribeEvent;\nimport cpw.mods.fml.common.gameevent.TickEvent.Phase;\nimport cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;\nimport cpw.mods.fml.relauncher.Side;\n\npublic class WorldTickEventHandler {\n\n\t@SubscribeEvent\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void tick(WorldTickEvent event) {\n\t\tif (event.side != Side.SERVER || event.phase != Phase.END)\n\t\t\treturn;\n\n\t\tWorld world = event.world;\n\t\tfor (TileEntity tile : (List) world.loadedTileEntityList) {\n\t\t\tBlock block = world.getBlock(tile.xCoord, tile.yCoord, tile.zCoord);\n\t\t\tif (block == Blocks.brewing_stand) {\n\t\t\t\tworld.setBlock(tile.xCoord, tile.yCoord, tile.zCoord, ModBlocks.brewing_stand);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}","subject":"Replace tiles after the world ticked. Might stop a crash with fastcraft"} {"old_contents":"package com.twitter.finagle.service;\n\nimport com.twitter.util.Duration;\nimport com.twitter.util.Stopwatch$;\n\n\/**\n * Java APIs for {@link RetryBudget}.\n *\/\npublic final class RetryBudgets {\n\n private RetryBudgets() {\n throw new IllegalStateException();\n }\n\n \/**\n * See {@link RetryBudget$#Empty()}\n *\/\n public static final RetryBudget EMPTY = RetryBudget$.MODULE$.Empty();\n\n \/**\n * See {@link RetryBudget$#Infinite()}\n *\/\n public static final RetryBudget INFINITE = RetryBudget$.MODULE$.Infinite();\n\n \/**\n * See {@link RetryBudget$#apply()}\n *\/\n public static RetryBudget newRetryBudget() {\n return RetryBudget$.MODULE$.apply();\n }\n\n \/**\n * See {@link RetryBudget$#apply()}\n *\/\n public static RetryBudget newRetryBudget(\n Duration ttl,\n int minRetriesPerSec,\n double percentCanRetry\n ) {\n return RetryBudget$.MODULE$.apply(\n ttl,\n minRetriesPerSec,\n percentCanRetry,\n Stopwatch$.MODULE$.systemMillis());\n }\n\n}\n","new_contents":"package com.twitter.finagle.service;\n\nimport com.twitter.util.Duration;\nimport com.twitter.util.Stopwatches;\n\n\/**\n * Java APIs for {@link RetryBudget}.\n *\/\npublic final class RetryBudgets {\n\n private RetryBudgets() {\n throw new IllegalStateException();\n }\n\n \/**\n * See {@link RetryBudget$#Empty()}\n *\/\n public static final RetryBudget EMPTY = RetryBudget$.MODULE$.Empty();\n\n \/**\n * See {@link RetryBudget$#Infinite()}\n *\/\n public static final RetryBudget INFINITE = RetryBudget$.MODULE$.Infinite();\n\n \/**\n * See {@link RetryBudget$#apply()}\n *\/\n public static RetryBudget newRetryBudget() {\n return RetryBudget$.MODULE$.apply();\n }\n\n \/**\n * See {@link RetryBudget$#apply()}\n *\/\n public static RetryBudget newRetryBudget(\n Duration ttl,\n int minRetriesPerSec,\n double percentCanRetry\n ) {\n return RetryBudget$.MODULE$.apply(\n ttl,\n minRetriesPerSec,\n percentCanRetry,\n Stopwatches.systemMillis());\n }\n\n}\n","subject":"Add Java friendly API for Stopwatch"} {"old_contents":"package com.navrit.dosenet;\n\npublic class Dosimeter {\n String name;\n double lastDose_uSv;\n String lastTime;\n \/\/double lastDose_mRem;\n \/\/double distance;\n \/\/double lat;\n \/\/double lon;\n\n \/\/ Image for card view\n\n \/\/List doses_uSv; \/\/ For dose over time plots\n \/\/List times;\n\n Dosimeter(String name, double lastDose_uSv, String lastTime){\n this.name = name;\n this.lastDose_uSv = lastDose_uSv;\n this.lastTime = lastTime;\n }\n\n}\n","new_contents":"package com.navrit.dosenet;\n\npublic class Dosimeter {\n String name;\n double lastDose_uSv;\n String lastTime;\n double lastDose_mRem;\n \/\/double distance;\n \/\/double lat;\n \/\/double lon;\n\n \/\/ Image for card view\n\n \/\/List doses_uSv; \/\/ For dose over time plots\n \/\/List times;\n\n Dosimeter(String name, double lastDose_uSv, String lastTime){\n this.name = name;\n this.lastDose_uSv = lastDose_uSv;\n this.lastTime = lastTime;\n this.lastDose_mRem = lastDose_uSv\/10;\n }\n\n}\n","subject":"Convert to mRem from uSv"} {"old_contents":"\/*\n * Copyright 2014 Texas A&M Engineering Experiment Station\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage edu.tamu.tcat.account;\n\n\/**\n * A base exception type for the Account library.\n *\/\npublic class AccountException extends Exception\n{\n public AccountException()\n {\n }\n\n public AccountException(String message)\n {\n super(message);\n }\n\n public AccountException(Throwable cause)\n {\n super(cause);\n }\n\n public AccountException(String message, Throwable cause)\n {\n super(message, cause);\n }\n\n public AccountException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)\n {\n super(message, cause, enableSuppression, writableStackTrace);\n }\n}\n","new_contents":"\/*\n * Copyright 2014 Texas A&M Engineering Experiment Station\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage edu.tamu.tcat.account;\n\n\/**\n * A base exception type for the Account library.\n *\/\npublic class AccountException extends RuntimeException\n{\n public AccountException()\n {\n }\n\n public AccountException(String message)\n {\n super(message);\n }\n\n public AccountException(Throwable cause)\n {\n super(cause);\n }\n\n public AccountException(String message, Throwable cause)\n {\n super(message, cause);\n }\n\n public AccountException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)\n {\n super(message, cause, enableSuppression, writableStackTrace);\n }\n}\n","subject":"Convert to unchecked exception hierarchy"} {"old_contents":"package net.fortytwo.twitlogic.persistence.sail;\n\nimport net.fortytwo.twitlogic.TwitLogic;\nimport net.fortytwo.twitlogic.persistence.SailFactory;\nimport net.fortytwo.twitlogic.util.properties.PropertyException;\nimport net.fortytwo.twitlogic.util.properties.TypedProperties;\nimport org.openrdf.sail.Sail;\nimport org.openrdf.sail.SailException;\nimport org.openrdf.sail.nativerdf.NativeStore;\n\nimport java.io.File;\nimport java.util.logging.Logger;\n\n\/**\n * User: josh\n * Date: May 18, 2010\n * Time: 5:26:47 PM\n *\/\npublic class NativeStoreFactory extends SailFactory {\n\n private static final Logger LOGGER = TwitLogic.getLogger(NativeStoreFactory.class);\n\n public NativeStoreFactory(final TypedProperties conf) {\n super(conf);\n }\n\n public Sail makeSail() throws SailException, PropertyException {\n File dir = conf.getFile(TwitLogic.NATIVESTORE_DIRECTORY);\n String indexes = conf.getString(TwitLogic.NATIVESTORE_INDEXES);\n\n LOGGER.info(\"instantiating NativeStore in directory: \" + dir);\n Sail sail = (null == indexes)\n ? new NativeStore(dir)\n : new NativeStore(dir, indexes.trim());\n sail.initialize();\n\n return sail;\n }\n}\n","new_contents":"package net.fortytwo.twitlogic.persistence.sail;\n\nimport net.fortytwo.twitlogic.TwitLogic;\nimport net.fortytwo.twitlogic.persistence.SailFactory;\nimport net.fortytwo.twitlogic.util.properties.PropertyException;\nimport net.fortytwo.twitlogic.util.properties.TypedProperties;\nimport org.openrdf.sail.Sail;\nimport org.openrdf.sail.SailException;\nimport org.openrdf.sail.nativerdf.NativeStore;\n\nimport java.io.File;\nimport java.util.logging.Logger;\n\n\/**\n * User: josh\n * Date: May 18, 2010\n * Time: 5:26:47 PM\n *\/\npublic class NativeStoreFactory extends SailFactory {\n\n private static final Logger LOGGER = TwitLogic.getLogger(NativeStoreFactory.class);\n\n public NativeStoreFactory(final TypedProperties conf) {\n super(conf);\n }\n\n public Sail makeSail() throws SailException, PropertyException {\n File dir = conf.getFile(TwitLogic.NATIVESTORE_DIRECTORY);\n String indexes = conf.getString(TwitLogic.NATIVESTORE_INDEXES, null);\n\n LOGGER.info(\"instantiating NativeStore in directory: \" + dir);\n Sail sail = (null == indexes)\n ? new NativeStore(dir)\n : new NativeStore(dir, indexes.trim());\n sail.initialize();\n\n return sail;\n }\n}\n","subject":"Tweak to make the new NativeStore indexes property *optional*."} {"old_contents":"package pl.com.chodera.myweather.network;\n\nimport pl.com.chodera.myweather.network.response.WeatherForecastResponse;\nimport pl.com.chodera.myweather.network.response.WeatherResponse;\nimport retrofit2.Call;\nimport retrofit2.http.GET;\nimport retrofit2.http.Query;\n\n\/**\n * Created by Adam Chodera on 2016-03-15.\n *\/\npublic interface RestClientService {\n\n @GET(\"weather?units=metric\")\n Call getWeather(\n @Query(\"q\") String location,\n @Query(\"appid\") String appId);\n\n @GET(\"forecast\/city?units=metric\")\n Call getForecastWeather(\n @Query(\"q\") String location,\n @Query(\"appid\") String appId);\n}","new_contents":"package pl.com.chodera.myweather.network;\n\nimport pl.com.chodera.myweather.network.response.WeatherForecastResponse;\nimport pl.com.chodera.myweather.network.response.WeatherResponse;\nimport retrofit2.Call;\nimport retrofit2.http.GET;\nimport retrofit2.http.Query;\n\n\/**\n * Created by Adam Chodera on 2016-03-15.\n *\/\npublic interface RestClientService {\n\n @GET(\"weather?units=metric\")\n Call getWeather(\n @Query(\"q\") String location,\n @Query(\"appid\") String appId);\n\n @GET(\"forecast?units=metric\")\n Call getForecastWeather(\n @Query(\"q\") String location,\n @Query(\"appid\") String appId);\n}","subject":"Update url for fetching forecast to fix recent 400 error"} {"old_contents":"\/*\n * Copyright 2015, TeamDev Ltd. All rights reserved.\n *\n * Redistribution and use in source and\/or binary forms, with or without\n * modification, must retain the above copyright notice and the following\n * disclaimer.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\npackage org.spine3.lang;\n\nimport org.spine3.Event;\n\n\/**\n * Exception that is thrown when unsupported event is obtained\n * or in case there is no class for given Protobuf event message.\n *\n * @author Mikhail Melnik\n *\/\npublic class MissingEventApplierException extends RuntimeException {\n\n public MissingEventApplierException(Event event) {\n super(\"There is no registered applier for the event: \" + event.getEventClass());\n }\n\n private static final long serialVersionUID = 0L;\n\n}\n","new_contents":"\/*\n * Copyright 2015, TeamDev Ltd. All rights reserved.\n *\n * Redistribution and use in source and\/or binary forms, with or without\n * modification, must retain the above copyright notice and the following\n * disclaimer.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\npackage org.spine3.lang;\n\nimport org.spine3.Event;\n\n\/**\n * This exception is thrown on a discovery of an event class, which is not handled by any of\n * the applier methods of an aggregate root class.\n *\n * @author Mikhail Melnik\n *\/\npublic class MissingEventApplierException extends RuntimeException {\n\n public MissingEventApplierException(Event event) {\n super(\"There is no registered applier for the event: \" + event.getEventClass());\n }\n\n private static final long serialVersionUID = 0L;\n\n}\n","subject":"Adjust Javadoc for the exception."} {"old_contents":"\/*\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.facebook.litho;\n\n\/** Data class for params used to log error in LithoView. *\/\npublic class ComponentLogParams {\n public final String logProductId;\n public final String logType;\n public final int samplingFrequency;\n public final boolean failHarder;\n\n public ComponentLogParams(\n String logProductId, String logType, int samplingFrequency, boolean failHarder) {\n this.logProductId = logProductId;\n this.logType = logType;\n this.samplingFrequency = samplingFrequency;\n this.failHarder = failHarder;\n }\n\n public ComponentLogParams(String logProductId, String logType) {\n this(logProductId, logType, \/* take default*\/ 0, false);\n }\n}\n","new_contents":"\/*\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.facebook.litho;\n\nimport com.facebook.infer.annotation.Nullsafe;\n\n\/** Data class for params used to log error in LithoView. *\/\n@Nullsafe(Nullsafe.Mode.LOCAL)\npublic class ComponentLogParams {\n public final String logProductId;\n public final String logType;\n public final int samplingFrequency;\n public final boolean failHarder;\n\n public ComponentLogParams(\n String logProductId, String logType, int samplingFrequency, boolean failHarder) {\n this.logProductId = logProductId;\n this.logType = logType;\n this.samplingFrequency = samplingFrequency;\n this.failHarder = failHarder;\n }\n\n public ComponentLogParams(String logProductId, String logType) {\n this(logProductId, logType, \/* take default*\/ 0, false);\n }\n}\n","subject":"Annotate clean classes as @Nullsafe:: (7\/14) libraries\/components\/litho-core\/src\/main\/java\/com\/facebook\/litho\/"} {"old_contents":"\/**\r\n * Get more info at : www.jrebirth.org .\r\n * Copyright JRebirth.org © 2011-2013\r\n * Contact : sebastien.bordes@jrebirth.org\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\/\r\npackage org.jrebirth.core.concurrent;\r\n\r\nimport java.lang.annotation.ElementType;\r\nimport java.lang.annotation.Retention;\r\nimport java.lang.annotation.RetentionPolicy;\r\nimport java.lang.annotation.Target;\r\n\r\n\/**\r\n * This annotation is used to.\r\n * \r\n * @author Sébastien Bordes\r\n *\/\r\n@Target({ ElementType.TYPE, ElementType.METHOD })\r\n@Retention(RetentionPolicy.RUNTIME)\r\npublic @interface RunInto {\r\n\r\n \/**\r\n * Define the RunType value.\r\n * \r\n * The default value is RunType.JIT\r\n *\/\r\n RunType value() default RunType.JIT;\r\n}\r\n","new_contents":"\/**\r\n * Get more info at : www.jrebirth.org .\r\n * Copyright JRebirth.org © 2011-2013\r\n * Contact : sebastien.bordes@jrebirth.org\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\/\r\npackage org.jrebirth.core.concurrent;\r\n\r\nimport java.lang.annotation.Documented;\r\nimport java.lang.annotation.ElementType;\r\nimport java.lang.annotation.Inherited;\r\nimport java.lang.annotation.Retention;\r\nimport java.lang.annotation.RetentionPolicy;\r\nimport java.lang.annotation.Target;\r\n\r\n\/**\r\n * This annotation is used to.\r\n * \r\n * @author Sébastien Bordes\r\n *\/\r\n@Target({ ElementType.TYPE, ElementType.METHOD })\r\n@Retention(RetentionPolicy.RUNTIME)\r\n@Inherited\r\n@Documented\r\npublic @interface RunInto {\r\n\r\n \/**\r\n * Define the RunType value.\r\n * \r\n * The default value is RunType.JIT\r\n *\/\r\n RunType value() default RunType.JIT;\r\n}\r\n","subject":"Document and inherit please :D"} {"old_contents":"package net.rebworks.lunchy.domain.places;\n\nimport net.rebworks.lunchy.domain.Place;\nimport net.rebworks.lunchy.resources.LunchResource;\n\nimport javax.inject.Inject;\nimport javax.ws.rs.core.Context;\nimport javax.ws.rs.core.UriInfo;\nimport java.net.URI;\nimport java.util.Arrays;\nimport java.util.SortedSet;\nimport java.util.TreeSet;\n\npublic class BangkokKitchen implements Place {\n\n private static final TreeSet ALIASES = new TreeSet<>(Arrays.asList(\"bangkokkitchen\", \"bkk\", \"bkgbg\"));\n public static final String NAME = ALIASES.first();\n\n private final UriInfo uriInfo;\n\n @Inject\n public BangkokKitchen(@Context final UriInfo uriInfo) {\n this.uriInfo = uriInfo;\n }\n\n @Override\n public String getName() {\n return NAME;\n }\n\n @Override\n public SortedSet getAliases() {\n return ALIASES;\n }\n\n @Override\n public URI getWebsite() {\n return URI.create(\"http:\/\/www.bkgbg.se\/lunch\");\n }\n\n @Override\n public URI getUri() {\n return LunchResource.getPlaceURI(uriInfo, NAME);\n }\n}\n","new_contents":"package net.rebworks.lunchy.domain.places;\n\nimport net.rebworks.lunchy.domain.Place;\nimport net.rebworks.lunchy.resources.LunchResource;\n\nimport javax.inject.Inject;\nimport javax.ws.rs.core.Context;\nimport javax.ws.rs.core.UriInfo;\nimport java.net.URI;\nimport java.util.Arrays;\nimport java.util.SortedSet;\nimport java.util.TreeSet;\n\npublic class BangkokKitchen implements Place {\n\n private static final TreeSet ALIASES = new TreeSet<>(Arrays.asList(\"bangkokkitchen\", \"bkk\", \"bkgbg\"));\n public static final String NAME = ALIASES.first();\n\n private final UriInfo uriInfo;\n\n @Inject\n public BangkokKitchen(@Context final UriInfo uriInfo) {\n this.uriInfo = uriInfo;\n }\n\n @Override\n public String getName() {\n return \"Bangkok Kitchen\";\n }\n\n @Override\n public SortedSet getAliases() {\n return ALIASES;\n }\n\n @Override\n public URI getWebsite() {\n return URI.create(\"http:\/\/www.bkgbg.se\/lunch\");\n }\n\n @Override\n public URI getUri() {\n return LunchResource.getPlaceURI(uriInfo, NAME);\n }\n}\n","subject":"Fix the name for Bangkok Kitchen"} {"old_contents":"package de.iani.cubequest.quests;\r\n\r\nimport de.iani.cubequest.Reward;\r\nimport de.iani.cubequest.conditions.GameModeCondition;\r\nimport de.iani.cubequest.conditions.ServerFlagCondition;\r\nimport org.bukkit.GameMode;\r\n\r\n\r\npublic abstract class EconomyInfluencingAmountQuest extends AmountQuest {\r\n \r\n public static final String SURVIVAL_ECONOMY_TAG = \"survival_economy\";\r\n \r\n public EconomyInfluencingAmountQuest(int id, String name, String displayMessage,\r\n String giveMessage, String successMessage, Reward successReward, int amount) {\r\n super(id, name, displayMessage, giveMessage, successMessage, successReward, amount);\r\n init();\r\n }\r\n \r\n public EconomyInfluencingAmountQuest(int id, String name, String displayMessage,\r\n String giveMessage, String successMessage, Reward successReward) {\r\n super(id, name, displayMessage, giveMessage, successMessage, successReward, 0);\r\n init();\r\n }\r\n \r\n public EconomyInfluencingAmountQuest(int id) {\r\n super(id);\r\n init();\r\n }\r\n \r\n private void init() {\r\n addQuestProgressCondition(new ServerFlagCondition(false, SURVIVAL_ECONOMY_TAG), false);\r\n addQuestProgressCondition(new GameModeCondition(false, GameMode.SURVIVAL), false);\r\n }\r\n \r\n}\r\n","new_contents":"package de.iani.cubequest.quests;\r\n\r\nimport de.iani.cubequest.Reward;\r\nimport de.iani.cubequest.conditions.ServerFlagCondition;\r\n\r\n\r\npublic abstract class EconomyInfluencingAmountQuest extends AmountQuest {\r\n \r\n public static final String SURVIVAL_ECONOMY_TAG = \"survival_economy\";\r\n \r\n public EconomyInfluencingAmountQuest(int id, String name, String displayMessage,\r\n String giveMessage, String successMessage, Reward successReward, int amount) {\r\n super(id, name, displayMessage, giveMessage, successMessage, successReward, amount);\r\n init();\r\n }\r\n \r\n public EconomyInfluencingAmountQuest(int id, String name, String displayMessage,\r\n String giveMessage, String successMessage, Reward successReward) {\r\n super(id, name, displayMessage, giveMessage, successMessage, successReward, 0);\r\n init();\r\n }\r\n \r\n public EconomyInfluencingAmountQuest(int id) {\r\n super(id);\r\n init();\r\n }\r\n \r\n private void init() {\r\n addQuestProgressCondition(new ServerFlagCondition(false, SURVIVAL_ECONOMY_TAG), false);\r\n }\r\n \r\n}\r\n","subject":"Remove duplicate default progress condition."} {"old_contents":"\/\/ Copyright 2015 The Chromium Authors. All rights reserved.\n\/\/ Use of this source code is governed by a BSD-style license that can be\n\/\/ found in the LICENSE file.\n\npackage org.chromium.chrome.browser.metrics;\n\nimport org.chromium.base.metrics.RecordHistogram;\n\n\/**\n * Centralizes UMA data collection for Android-specific MediaSession features.\n *\/\npublic class MediaSessionUMA {\n \/\/ MediaSessionAction defined in tools\/metrics\/histograms\/histograms.xml.\n public static final int MEDIA_SESSION_ACTION_SOURCE_MEDIA_NOTIFICATION = 0;\n public static final int MEDIA_SESSION_ACTION_SOURCE_MAX = 1;\n\n public static void recordPlay(int action) {\n assert action >= 0 && action < MEDIA_SESSION_ACTION_SOURCE_MAX;\n RecordHistogram.recordEnumeratedHistogram(\"Media.Session.Play\", action,\n MEDIA_SESSION_ACTION_SOURCE_MAX);\n }\n\n public static void recordPause(int action) {\n assert action >= 0 && action < MEDIA_SESSION_ACTION_SOURCE_MAX;\n RecordHistogram.recordEnumeratedHistogram(\"Media.Session.Pause\", action,\n MEDIA_SESSION_ACTION_SOURCE_MAX);\n }\n}\n","new_contents":"\/\/ Copyright 2015 The Chromium Authors. All rights reserved.\n\/\/ Use of this source code is governed by a BSD-style license that can be\n\/\/ found in the LICENSE file.\n\npackage org.chromium.chrome.browser.metrics;\n\nimport org.chromium.base.metrics.RecordHistogram;\n\n\/**\n * Centralizes UMA data collection for Android-specific MediaSession features.\n *\/\npublic class MediaSessionUMA {\n \/\/ MediaSessionAction defined in tools\/metrics\/histograms\/histograms.xml.\n public static final int MEDIA_SESSION_ACTION_SOURCE_MEDIA_NOTIFICATION = 0;\n \/\/ TODO(mlamouri): UMA do not handle well enumerations with only one value.\n \/\/ Other values will be addede later (like RemoteContro\/MediaSession\/etc.)\n \/\/ interactions but we have to fax the max value for now in order to prevent\n \/\/ crashes.\n public static final int MEDIA_SESSION_ACTION_SOURCE_MAX = 2;\n\n public static void recordPlay(int action) {\n assert action >= 0 && action < MEDIA_SESSION_ACTION_SOURCE_MAX;\n RecordHistogram.recordEnumeratedHistogram(\"Media.Session.Play\", action,\n MEDIA_SESSION_ACTION_SOURCE_MAX);\n }\n\n public static void recordPause(int action) {\n assert action >= 0 && action < MEDIA_SESSION_ACTION_SOURCE_MAX;\n RecordHistogram.recordEnumeratedHistogram(\"Media.Session.Pause\", action,\n MEDIA_SESSION_ACTION_SOURCE_MAX);\n }\n}\n","subject":"Fix crash because of UMA enum with only one value."} {"old_contents":"package com.cdrussell.caster.rx.casterrxjava;\n\n\nimport android.os.SystemClock;\nimport android.util.Log;\n\nclass Database {\n\n private static final String TAG = Database.class.getSimpleName();\n\n static String readValue() {\n SystemClock.sleep(50);\n\n for (int i = 0; i < 100; i++) {\n Log.i(TAG, String.format(\"Reading value: %d%%\", i));\n SystemClock.sleep(20);\n }\n Log.i(TAG, \"Reading value: 100%\");\n return \"Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\";\n }\n}\n","new_contents":"package com.cdrussell.caster.rx.casterrxjava;\n\n\nimport android.os.SystemClock;\nimport android.util.Log;\n\n\/**\n * Fake database implementation that is slow to return a value.\n *\/\nclass Database {\n\n private static final String TAG = Database.class.getSimpleName();\n\n static String readValue() {\n SystemClock.sleep(50);\n\n for (int i = 0; i < 100; i++) {\n Log.i(TAG, String.format(\"Reading value: %d%%\", i));\n SystemClock.sleep(20);\n }\n Log.i(TAG, \"Reading value: 100%\");\n \n return \"Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\";\n }\n}\n","subject":"Add class comment detailing class is a fake database"} {"old_contents":"package com.github.macrodata.skyprint.section;\n\nimport lombok.Setter;\nimport lombok.ToString;\n\nimport java.util.List;\n\nimport static com.github.macrodata.skyprint.section.SectionHelper.*;\n\n@ToString\npublic class RootSection extends Section {\n\n @Setter\n private MetadataSection metadata;\n\n @Setter\n private String name;\n\n @Setter\n private List resources;\n\n @Setter\n private List groups;\n\n public MetadataSection getMetadata() {\n if (metadata == null)\n lazy(this::setMetadata, get(this, MetadataSection.class));\n return metadata;\n }\n\n public String getName() {\n if (name == null)\n lazy(this::setName, get(this, OverviewSection.class).getName());\n return name;\n }\n\n @Override\n public String getDescription() {\n if (super.getDescription() == null)\n lazy(this::setDescription, get(this, OverviewSection.class).getDescription());\n return super.getDescription();\n }\n\n public List getResources() {\n if (resources == null)\n lazy(this::setResources, list(this, ResourceSection.class));\n return resources;\n }\n\n public List getGroups() {\n if (groups == null)\n lazy(this::setGroups, list(this, GroupSection.class));\n return groups;\n }\n\n}","new_contents":"package com.github.macrodata.skyprint.section;\n\nimport lombok.Setter;\nimport lombok.ToString;\n\nimport javax.xml.transform.stream.StreamSource;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Stream;\n\nimport static com.github.macrodata.skyprint.section.SectionHelper.*;\n\n@ToString\npublic class RootSection extends Section {\n\n @Setter\n private Map metadata;\n\n @Setter\n private String name;\n\n @Setter\n private List resources;\n\n @Setter\n private List groups;\n\n public Map getMetadata() {\n if (metadata == null)\n lazy(this::setMetadata, get(this, MetadataSection.class));\n return metadata;\n }\n\n public String getName() {\n if (name == null)\n lazy(this::setName, get(this, OverviewSection.class).getName());\n return name;\n }\n\n @Override\n public String getDescription() {\n if (super.getDescription() == null)\n lazy(this::setDescription, get(this, OverviewSection.class).getDescription());\n return super.getDescription();\n }\n\n public List getResources() {\n if (resources == null)\n lazy(this::setResources, list(this, ResourceSection.class));\n return resources;\n }\n\n public List getGroups() {\n if (groups == null)\n lazy(this::setGroups, list(this, GroupSection.class));\n return groups;\n }\n\n}","subject":"Change metadata type to map"} {"old_contents":"package org.jenkinsci.plugins.codedx.model;\n\npublic enum StatisticGroup {\n Unspecified(\"Unspecified\"),\n Info(\"Info\"),\n Low(\"Low\"),\n Medium(\"Medium\"),\n High(\"High\"),\n\n FalsePositives(\"False Positives\"),\n Ignored(\"Ignored\"),\n Escalated(\"Escalated\"),\n Assigned(\"Assigned\"),\n Fixed(\"Fixed\"),\n Unresolved(\"Unresolved\"),\n New(\"New\");\n\n private String value;\n\n private StatisticGroup(String value) {\n this.value = value;\n }\n\n public String toString() {\n return value;\n }\n\n public static StatisticGroup forValue(String value) {\n for (StatisticGroup group : StatisticGroup.values()) {\n if (group.value.equals(value)) {\n return group;\n }\n }\n return null;\n }\n\n}\n","new_contents":"package org.jenkinsci.plugins.codedx.model;\n\npublic enum StatisticGroup {\n Unspecified(\"Unspecified\"),\n Info(\"Info\"),\n Low(\"Low\"),\n Medium(\"Medium\"),\n High(\"High\"),\n\n FalsePositive(\"False Positive\"),\n Ignored(\"Ignored\"),\n Escalated(\"Escalated\"),\n Assigned(\"Assigned\"),\n Fixed(\"Fixed\"),\n Unresolved(\"Unresolved\"),\n New(\"New\");\n\n private String value;\n\n private StatisticGroup(String value) {\n this.value = value;\n }\n\n public String toString() {\n return value;\n }\n\n public static StatisticGroup forValue(String value) {\n for (StatisticGroup group : StatisticGroup.values()) {\n if (group.value.equals(value)) {\n return group;\n }\n }\n return null;\n }\n\n}\n","subject":"Fix typo that was causing null pointer exceptions"} {"old_contents":"package cpw.mods.fml.common.launcher;\n\nimport cpw.mods.fml.relauncher.FMLLaunchHandler;\nimport net.minecraft.launchwrapper.LaunchClassLoader;\n\npublic class FMLServerTweaker extends FMLTweaker {\n @Override\n public String getLaunchTarget()\n {\n return \"net.minecraft.server.MinecraftServer\";\n }\n\n @Override\n public void injectIntoClassLoader(LaunchClassLoader classLoader)\n {\n classLoader.addClassLoaderExclusion(\"com.mojang.util.\");\n classLoader.addTransformerExclusion(\"cpw.mods.fml.repackage.\");\n classLoader.addTransformerExclusion(\"cpw.mods.fml.relauncher.\");\n classLoader.addTransformerExclusion(\"cpw.mods.fml.common.asm.transformers.\");\n classLoader.addClassLoaderExclusion(\"LZMA.\");\n FMLLaunchHandler.configureForServerLaunch(classLoader, this);\n FMLLaunchHandler.appendCoreMods();\n }\n}\n","new_contents":"package cpw.mods.fml.common.launcher;\n\nimport cpw.mods.fml.relauncher.FMLLaunchHandler;\nimport net.minecraft.launchwrapper.LaunchClassLoader;\n\npublic class FMLServerTweaker extends FMLTweaker {\n @Override\n public String getLaunchTarget()\n {\n return \"net.minecraft.server.MinecraftServer\";\n }\n\n @Override\n public void injectIntoClassLoader(LaunchClassLoader classLoader)\n {\n \/\/ The mojang packages are excluded so the log4j2 queue is correctly visible from\n \/\/ the obfuscated and deobfuscated parts of the code. Without, the UI won't show anything\n classLoader.addClassLoaderExclusion(\"com.mojang.\");\n classLoader.addTransformerExclusion(\"cpw.mods.fml.repackage.\");\n classLoader.addTransformerExclusion(\"cpw.mods.fml.relauncher.\");\n classLoader.addTransformerExclusion(\"cpw.mods.fml.common.asm.transformers.\");\n classLoader.addClassLoaderExclusion(\"LZMA.\");\n FMLLaunchHandler.configureForServerLaunch(classLoader, this);\n FMLLaunchHandler.appendCoreMods();\n }\n}\n","subject":"Fix server side to write properly"} {"old_contents":"package de.craften.craftenlauncher.logic.download;\n\nimport com.google.gson.Gson;\nimport com.google.gson.JsonElement;\nimport com.google.gson.JsonObject;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class VersionLoader {\n public static List getVersionStringList() {\n String jsonString = DownloadHelper.downloadFileToString(\"https:\/\/s3.amazonaws.com\/Minecraft.Download\/versions\/versions.json\");\n JsonObject versionsJson = new Gson().fromJson(jsonString, JsonObject.class);\n\n List versions = new ArrayList<>();\n for (JsonElement version : versionsJson.getAsJsonArray(\"versions\")) {\n versions.add(version.getAsJsonObject().get(\"id\").getAsString());\n }\n return versions;\n }\n}\n","new_contents":"package de.craften.craftenlauncher.logic.download;\n\nimport com.google.gson.Gson;\nimport com.google.gson.JsonElement;\nimport com.google.gson.JsonObject;\nimport org.apache.logging.log4j.LogManager;\nimport org.apache.logging.log4j.Logger;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class VersionLoader {\n private static final Logger LOGGER = LogManager.getLogger(VersionLoader.class);\n\n public static List getVersionStringList() {\n String jsonString = DownloadHelper.downloadFileToString(\"https:\/\/s3.amazonaws.com\/Minecraft.Download\/versions\/versions.json\");\n JsonObject versionsJson = new Gson().fromJson(jsonString, JsonObject.class);\n\n if (versionsJson != null) {\n List versions = new ArrayList<>();\n for (JsonElement version : versionsJson.getAsJsonArray(\"versions\")) {\n versions.add(version.getAsJsonObject().get(\"id\").getAsString());\n }\n return versions;\n } else {\n LOGGER.warn(\"Downloading versions list failed, using local versions only\");\n return new ArrayList<>(); \/\/TODO cache the versions or throw an exception\n }\n }\n}\n","subject":"Fix crash when the launcher is started without internet access."} {"old_contents":"\/*\n * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.\n *\n * Distributable under LGPL license.\n * See terms of license at gnu.org.\n *\/\npackage net.java.sip.communicator.impl.neomedia.device;\n\nimport javax.media.*;\n\nimport net.java.sip.communicator.impl.neomedia.imgstreaming.*;\nimport net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.imgstreaming.*;\n\n\/**\n * Add ImageStreaming capture device.\n * \n * @author Sebastien Vincent\n *\/\npublic class ImageStreamingAuto\n{\n \/**\n * Add capture devices.\n *\n * @throws Exception if problem when adding capture devices\n *\/\n public ImageStreamingAuto() throws Exception\n {\n String name = \"Desktop streaming\";\n CaptureDeviceInfo devInfo\n = new CaptureDeviceInfo(\n name,\n new MediaLocator(\n ImageStreamingUtils.LOCATOR_PROTOCOL + \":\" + name),\n DataSource.getFormats());\n \n \/* add to JMF device manager *\/\n CaptureDeviceManager.addDevice(devInfo);\n CaptureDeviceManager.commit();\n }\n}\n","new_contents":"\/*\n * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.\n *\n * Distributable under LGPL license.\n * See terms of license at gnu.org.\n *\/\npackage net.java.sip.communicator.impl.neomedia.device;\n\nimport javax.media.*;\n\nimport net.java.sip.communicator.impl.neomedia.imgstreaming.*;\nimport net.java.sip.communicator.impl.neomedia.jmfext.media.protocol.imgstreaming.*;\n\n\/**\n * Add ImageStreaming capture device.\n * \n * @author Sebastien Vincent\n *\/\npublic class ImageStreamingAuto\n{\n \/**\n * Add capture devices.\n *\n * @throws Exception if problem when adding capture devices\n *\/\n public ImageStreamingAuto() throws Exception\n {\n String name = \"Experimental desktop streaming\";\n CaptureDeviceInfo devInfo\n = new CaptureDeviceInfo(\n name,\n new MediaLocator(\n ImageStreamingUtils.LOCATOR_PROTOCOL + \":\" + name),\n DataSource.getFormats());\n \n \/* add to JMF device manager *\/\n CaptureDeviceManager.addDevice(devInfo);\n CaptureDeviceManager.commit();\n }\n}\n","subject":"Change name displayed for desktop streaming device in the media configuration panel."} {"old_contents":"package io.quarkus.cli.core;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.nio.file.Files;\nimport java.util.Properties;\n\nimport io.smallrye.common.classloader.ClassPathUtils;\nimport picocli.CommandLine;\n\npublic class QuarkusCliVersion implements CommandLine.IVersionProvider {\n\n private static String version;\n\n public static String version() {\n if (version != null) {\n return version;\n }\n final URL quarkusPropsUrl = Thread.currentThread().getContextClassLoader().getResource(\"quarkus.properties\");\n if (quarkusPropsUrl == null) {\n throw new RuntimeException(\"Failed to locate quarkus.properties on the classpath\");\n }\n final Properties props = new Properties();\n ClassPathUtils.consumeAsPath(quarkusPropsUrl, p -> {\n try (BufferedReader reader = Files.newBufferedReader(p)) {\n props.load(reader);\n } catch (IOException e) {\n throw new RuntimeException(\"Failed to load quarkus.properties\", e);\n }\n });\n version = props.getProperty(\"quarkus-core-version\");\n if (version == null) {\n throw new RuntimeException(\"Failed to locate quarkus-core-version property in the bundled quarkus.properties\");\n }\n return version;\n }\n\n @Override\n public String[] getVersion() throws Exception {\n return new String[] { version() };\n }\n\n}\n","new_contents":"package io.quarkus.cli.core;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.nio.file.Files;\nimport java.util.Properties;\n\nimport io.smallrye.common.classloader.ClassPathUtils;\nimport picocli.CommandLine;\n\npublic class QuarkusCliVersion implements CommandLine.IVersionProvider {\n\n private static String version;\n\n public static String version() {\n if (version != null) {\n return version;\n }\n\n final Properties props = new Properties();\n final URL quarkusPropertiesUrl = Thread.currentThread().getContextClassLoader().getResource(\"quarkus.properties\");\n if (quarkusPropertiesUrl == null) {\n throw new RuntimeException(\"Failed to locate quarkus.properties on the classpath\");\n }\n\n \/\/ we have a special case for file and jar as using getResourceAsStream() on Windows might cause file locks\n if (\"file\".equals(quarkusPropertiesUrl.getProtocol()) || \"jar\".equals(quarkusPropertiesUrl.getProtocol())) {\n ClassPathUtils.consumeAsPath(quarkusPropertiesUrl, p -> {\n try (BufferedReader reader = Files.newBufferedReader(p)) {\n props.load(reader);\n } catch (IOException e) {\n throw new RuntimeException(\"Failed to load quarkus.properties\", e);\n }\n });\n } else {\n try {\n props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(\"quarkus.properties\"));\n } catch (IOException e) {\n throw new IllegalStateException(\"Failed to load quarkus.properties\", e);\n }\n }\n\n version = props.getProperty(\"quarkus-core-version\");\n if (version == null) {\n throw new RuntimeException(\"Failed to locate quarkus-core-version property in the bundled quarkus.properties\");\n }\n\n return version;\n }\n\n @Override\n public String[] getVersion() throws Exception {\n return new String[] { version() };\n }\n\n}\n","subject":"Simplify loading of Quarkus CLI version"} {"old_contents":"package model;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertNotNull;\n\n\/**\n * Tests {@link FileLink FileLink} class.\n *\n * @author Shawn Aten (shawn@filestack.com)\n *\/\npublic class TestFileLink {\n private static final String API_KEY = \"XXXXXXXXXXXXXXXXXXXXXXX\";\n private static final String HANDLE = \"XXXXXXXXXXXXXXXXXXXXX\";\n\n @Test\n public void testInstantiation() {\n FileLink fileLink = new FileLink(API_KEY, HANDLE);\n assertNotNull(\"Unable to create FileLink\", fileLink);\n }\n}\n","new_contents":"package model;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertNotNull;\n\n\/**\n * Tests {@link FileLink FileLink} class.\n *\/\npublic class TestFileLink {\n private static final String API_KEY = \"XXXXXXXXXXXXXXXXXXXXXXX\";\n private static final String HANDLE = \"XXXXXXXXXXXXXXXXXXXXX\";\n\n @Test\n public void testInstantiation() {\n FileLink fileLink = new FileLink(API_KEY, HANDLE);\n assertNotNull(\"Unable to create FileLink\", fileLink);\n }\n}\n","subject":"Remove @author annotation in Javadoc."} {"old_contents":"package com.avairebot.orion.scheduler;\n\nimport com.avairebot.orion.Orion;\nimport com.avairebot.orion.cache.CacheType;\nimport com.avairebot.orion.cache.adapters.MemoryAdapter;\nimport com.avairebot.orion.contracts.scheduler.Job;\n\npublic class GarbageCollectorJob extends Job {\n\n public GarbageCollectorJob(Orion orion) {\n super(orion);\n }\n\n @Override\n public void run() {\n MemoryAdapter adapter = (MemoryAdapter) orion.getCache().getAdapter(CacheType.MEMORY);\n\n for (String key : adapter.getCacheKeys()) {\n if (!adapter.has(key)) {\n adapter.forget(key);\n }\n }\n }\n}\n","new_contents":"package com.avairebot.orion.scheduler;\n\nimport com.avairebot.orion.Orion;\nimport com.avairebot.orion.audio.AudioHandler;\nimport com.avairebot.orion.audio.GuildMusicManager;\nimport com.avairebot.orion.cache.CacheType;\nimport com.avairebot.orion.cache.adapters.MemoryAdapter;\nimport com.avairebot.orion.contracts.scheduler.Job;\n\nimport java.util.Map;\n\npublic class GarbageCollectorJob extends Job {\n\n public GarbageCollectorJob(Orion orion) {\n super(orion);\n }\n\n @Override\n public void run() {\n MemoryAdapter adapter = (MemoryAdapter) orion.getCache().getAdapter(CacheType.MEMORY);\n\n adapter.getCacheKeys().removeIf(key -> !adapter.has(key));\n\n for (Map.Entry entry : AudioHandler.MUSIC_MANAGER.entrySet()) {\n if (entry.getValue() == null) {\n AudioHandler.MUSIC_MANAGER.remove(entry.getKey());\n continue;\n }\n\n if (entry.getValue().getLastActiveMessage() == null) {\n continue;\n }\n\n if (entry.getValue().getLastActiveMessage().getGuild().getAudioManager().isConnected()) {\n continue;\n }\n\n if (!adapter.has(getCacheFingerprint(entry.getKey()))) {\n adapter.put(getCacheFingerprint(entry.getKey()), 0, 120);\n continue;\n }\n\n adapter.forget(getCacheFingerprint(entry.getKey()));\n\n AudioHandler.MUSIC_MANAGER.remove(entry.getKey());\n }\n }\n\n private String getCacheFingerprint(Long guildId) {\n return \"garbage-collector.music-queue.\" + guildId;\n }\n}\n","subject":"Add music manager cleanup to the garbage collector"} {"old_contents":"package com.ichorcommunity.latch.enums;\n\npublic enum LockType {\n \/*\n * Accessible by everyone\n *\/\n PUBLIC,\n\n \/*\n * Accessible by the group\n *\/\n GUILD,\n\n \/*\n * Requires a password every time to use\n *\/\n PASSWORD_ALWAYS,\n\n \/*\n * Requires a password the first time a player accesses it\n *\/\n PASSWORD_ONCE,\n\n \/*\n * Owned\/controlled by one person, access able to be shared\n *\/\n PRIVATE,\n\n \/*\n * Allows all players to deposit items, only the owner to withdraw\n *\/\n DONATION;\n\n}\n","new_contents":"package com.ichorcommunity.latch.enums;\n\npublic enum LockType {\n \/*\n * Accessible by everyone\n *\/\n PUBLIC,\n\n \/*\n * Accessible by the group\n *\/\n GUILD,\n\n \/*\n * Requires a password every time to use\n *\/\n PASSWORD_ALWAYS,\n\n \/*\n * Requires a password the first time a player accesses it\n *\/\n PASSWORD_ONCE,\n\n \/*\n * Owned\/controlled by one person, access able to be shared\n *\/\n PRIVATE;\n\n \/*\n * Allows all players to deposit items, only the owner to withdraw\n *\/\n \/\/Donation locks not possible to make without Sponge Inventory implementation\n \/\/DONATION;\n\n}\n","subject":"Disable donation lock for now"} {"old_contents":"package org.scenarioo.mytinytodo;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.scenarioo.mytinytodo.base.TinyTodoWebTest;\nimport org.scenarioo.mytinytodo.pages.TaskListsPage;\nimport org.scenarioo.mytinytodo.pages.TasksPage;\n\npublic class TaskListManagementWebTest extends TinyTodoWebTest {\n\t\n\tprivate TaskListsPage taskListsPage;\n\tprivate TasksPage tasksPage;\n\t\n\t@Before\n\tpublic void init() {\n\t\ttaskListsPage = create(TaskListsPage.class);\n\t\ttasksPage = create(TasksPage.class);\n\t}\n\t\n\t@Test\n\tpublic void createTaskList() {\n\t\tstart();\n\t\ttaskListsPage.createTaskList(\"Todo 2\");\n\t\ttaskListsPage.showTaskList(\"Todo 2\");\n\t\ttasksPage.assertIsEmpty();\n\t}\n\t\n\t@Test\n\tpublic void renameTaskList() {\n\t\tstart();\n\t\ttaskListsPage.createTaskList(\"Todo with spelling mstake\");\n\t\ttaskListsPage.selectTaskList(\"Todo with spelling mstake\");\n\t\ttaskListsPage.renameSelectedTaskList(\"Todo without spelling mistake\");\n\t}\n\t\n\t@Test\n\tpublic void deleteTaskList() {\n\t\tstart();\n\t\ttaskListsPage.createTaskList(\"Todo to be removed\");\n\t\ttaskListsPage.selectTaskList(\"Todo to be removed\");\n\t\ttaskListsPage.deleteSelectedTaskList();\n\t}\n}\n","new_contents":"package org.scenarioo.mytinytodo;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.scenarioo.mytinytodo.base.TinyTodoWebTest;\nimport org.scenarioo.mytinytodo.pages.TaskListsPage;\nimport org.scenarioo.mytinytodo.pages.TasksPage;\n\npublic class TaskListManagementWebTest extends TinyTodoWebTest {\n\t\n\tprivate TaskListsPage taskListsPage;\n\tprivate TasksPage tasksPage;\n\t\n\t@Before\n\tpublic void init() {\n\t\ttaskListsPage = create(TaskListsPage.class);\n\t\ttasksPage = create(TasksPage.class);\n\t}\n\t\n\t@Test\n\tpublic void createTaskList() {\n\t\tstart();\n\t\ttaskListsPage.createTaskList(\"Todo 2\");\n\t\ttaskListsPage.selectTaskList(\"Todo 2\");\n\t\ttasksPage.assertIsEmpty();\n\t}\n\t\n\t@Test\n\tpublic void renameTaskList() {\n\t\tstart();\n\t\ttaskListsPage.createTaskList(\"Todo with spelling mstake\");\n\t\ttaskListsPage.selectTaskList(\"Todo with spelling mstake\");\n\t\ttaskListsPage.renameSelectedTaskList(\"Todo without spelling mistake\");\n\t}\n\t\n\t@Test\n\tpublic void deleteTaskList() {\n\t\tstart();\n\t\ttaskListsPage.createTaskList(\"Todo to be removed\");\n\t\ttaskListsPage.selectTaskList(\"Todo to be removed\");\n\t\ttaskListsPage.deleteSelectedTaskList();\n\t}\n}\n","subject":"Remove strange old \"showTaskList\" call now and forever!"} {"old_contents":"package com.pholser.junit.quickcheck.internal.generator;\n\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.Target;\n\nimport static java.lang.annotation.ElementType.*;\nimport static java.lang.annotation.RetentionPolicy.RUNTIME;\n\n\/**\n *

      Mark a parameter of a {@link com.pholser.junit.quickcheck.Property}\n * method with this annotation, in addition to {@link javax.annotation.Nullable},\n * to configure the probability of generating a null value.<\/p>\n *\/\n@Target({ PARAMETER, FIELD, ANNOTATION_TYPE, TYPE_USE })\n@Retention(RUNTIME)\npublic @interface NullAllowed {\n \/**\n * @return probability of generating null {@code float} value, in the range [0,1]\n *\/\n float probability() default 0.5f;\n}\n","new_contents":"package com.pholser.junit.quickcheck.internal.generator;\n\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.Target;\n\nimport static java.lang.annotation.ElementType.*;\nimport static java.lang.annotation.RetentionPolicy.RUNTIME;\n\n\/**\n *

      Mark a parameter of a {@link com.pholser.junit.quickcheck.Property}\n * method with this annotation, in addition to {@link javax.annotation.Nullable},\n * to configure the probability of generating a null value.<\/p>\n *\/\n@Target({ PARAMETER, FIELD, ANNOTATION_TYPE, TYPE_USE })\n@Retention(RUNTIME)\npublic @interface NullAllowed {\n \/**\n * @return probability of generating null {@code float} value, in the range [0,1]\n *\/\n float probability() default 0.2f;\n}\n","subject":"Reduce default probability of nulls"} {"old_contents":"package me.soundlocker.soundlocker;\n\nimport android.os.AsyncTask;\n\nimport org.apache.commons.lang3.ArrayUtils;\nimport java.io.BufferedInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\n\npublic class DownloadSongByteData extends AsyncTask {\n\n @Override\n protected Byte[] doInBackground(URL... params) {\n URL url = params[0];\n HttpURLConnection urlConnection = null;\n try {\n urlConnection = (HttpURLConnection) url.openConnection();\n InputStream fileInputStream = new BufferedInputStream(urlConnection.getInputStream());\n byte[] result = inputStreamToByteArray(fileInputStream);\n return ArrayUtils.toObject(result);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n urlConnection.disconnect();\n }\n return null;\n }\n\n private byte[] inputStreamToByteArray(InputStream inStream) throws IOException {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n byte[] buffer = new byte[8192];\n int bytesRead;\n while ((bytesRead = inStream.read(buffer)) > 0) {\n baos.write(buffer, 0, bytesRead);\n }\n return baos.toByteArray();\n }\n}\n","new_contents":"package me.soundlocker.soundlocker;\n\nimport android.os.AsyncTask;\n\nimport org.apache.commons.lang3.ArrayUtils;\n\nimport java.io.BufferedInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.URL;\n\nimport javax.net.ssl.HttpsURLConnection;\n\npublic class DownloadSongByteData extends AsyncTask {\n\n @Override\n protected Byte[] doInBackground(URL... params) {\n URL url = params[0];\n HttpsURLConnection urlConnection = null;\n try {\n urlConnection = (HttpsURLConnection) url.openConnection();\n InputStream fileInputStream = new BufferedInputStream(urlConnection.getInputStream());\n byte[] result = inputStreamToByteArray(fileInputStream);\n return ArrayUtils.toObject(result);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n urlConnection.disconnect();\n }\n return null;\n }\n\n private byte[] inputStreamToByteArray(InputStream inStream) throws IOException {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n byte[] buffer = new byte[8192];\n int bytesRead;\n while ((bytesRead = inStream.read(buffer)) > 0) {\n baos.write(buffer, 0, bytesRead);\n }\n return baos.toByteArray();\n }\n}\n","subject":"Use HttpsURLConnection for Spotify previews"} {"old_contents":"package de.tuberlin.dima.schubotz.fse.mappers;\n\nimport eu.stratosphere.api.java.functions.FlatMapFunction;\nimport eu.stratosphere.util.Collector;\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\n\n\/**\n * Cleans main task queries. TODO find way to do this using stratosphere built in data input?\n * Required due to Stratosphere split on {@link de.tuberlin.dima.schubotz.fse.MainProgram#QUERY_SEPARATOR}\n *\/\npublic class QueryCleaner extends FlatMapFunction {\n\tLog LOG = LogFactory.getLog(QueryCleaner.class);\n\t\n\t@Override\n\tpublic void flatMap(String in, Collector out) throws Exception {\n\t\tif (in.trim().length() == 0 || in.startsWith(\"\\r\\n<\/topics>\")) {\n\t\t\tif (LOG.isWarnEnabled()) {\n\t\t\t\tLOG.warn(\"Corrupt query \" + in); \n\t\t\t}\n\t\t\treturn; \n\t\t}\n\t\tif (in.startsWith(\"<\/topics>\";\n\t\t}else if (!in.endsWith( \"<\/topic>\" )) {\n\t\t\tin += \"<\/topic>\";\n\t\t}\n\t\tout.collect(in);\n\t}\n}","new_contents":"package de.tuberlin.dima.schubotz.fse.mappers;\n\nimport eu.stratosphere.api.java.functions.FlatMapFunction;\nimport eu.stratosphere.util.Collector;\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\n\n\/**\n * Cleans main task queries. TODO find way to do this using stratosphere built in data input?\n * Required due to Stratosphere split on {@link de.tuberlin.dima.schubotz.fse.MainProgram#QUERY_SEPARATOR}\n *\/\npublic class QueryCleaner extends FlatMapFunction {\n\tLog LOG = LogFactory.getLog(QueryCleaner.class);\n\t\n\t@Override\n\tpublic void flatMap(String in, Collector out) throws Exception {\n \/\/TODO: check if \\r is required\n\t\tif (in.trim().length() == 0 || in.startsWith(\"\\r\\n<\/topics>\")) {\n\t\t\tif (LOG.isWarnEnabled()) {\n\t\t\t\tLOG.warn(\"Corrupt query \" + in); \n\t\t\t}\n\t\t\treturn; \n\t\t}\n\t\tif (in.startsWith(\"<\/topics>\";\n\t\t}else if (!in.endsWith( \"<\/topic>\" )) {\n\t\t\tin += \"<\/topic>\";\n\t\t}\n\t\tout.collect(in);\n\t}\n}","subject":"Make \\r in topics optional"} {"old_contents":"package jpaoletti.jpm.core.operations;\n\nimport java.util.List;\nimport jpaoletti.jpm.core.InstanceId;\nimport jpaoletti.jpm.core.PMContext;\nimport jpaoletti.jpm.core.PMException;\n\n\/**\n *\n * @author jpaoletti\n *\/\npublic class SelectItemOperation extends OperationCommandSupport {\n\n public SelectItemOperation(String operationId) {\n super(operationId);\n }\n\n public SelectItemOperation() {\n super(\"selectitem\");\n }\n\n @Override\n protected void doExecute(PMContext ctx) throws PMException {\n super.doExecute(ctx);\n final String _item = (String) ctx.getParameter(\"idx\");\n if (_item != null) {\n final InstanceId id = buildInstanceId(ctx.getEntity(), _item);\n final List selectedIndexes = ctx.getEntityContainer().getSelectedInstanceIds();\n if (selectedIndexes.contains(id)) {\n selectedIndexes.remove(id);\n } else {\n selectedIndexes.add(id);\n }\n }\n }\n\n @Override\n protected boolean checkEntity() {\n return true;\n }\n}\n","new_contents":"package jpaoletti.jpm.core.operations;\n\nimport java.util.List;\nimport jpaoletti.jpm.core.InstanceId;\nimport jpaoletti.jpm.core.PMContext;\nimport jpaoletti.jpm.core.PMException;\n\n\/**\n *\n * @author jpaoletti\n *\/\npublic class SelectItemOperation extends OperationCommandSupport {\n\n public SelectItemOperation(String operationId) {\n super(operationId);\n }\n\n public SelectItemOperation() {\n super(\"selectitem\");\n }\n\n @Override\n protected void doExecute(PMContext ctx) throws PMException {\n super.doExecute(ctx);\n final String _item = (String) ctx.getParameter(\"idx\");\n if (_item != null) {\n final InstanceId id = buildInstanceId(ctx.getEntity(), _item);\n final List selectedIndexes = ctx.getEntityContainer().getSelectedInstanceIds();\n if (selectedIndexes.contains(id)) {\n selectedIndexes.remove(id);\n } else {\n selectedIndexes.add(id);\n }\n }\n }\n\n @Override\n protected boolean checkEntity() {\n return true;\n }\n\n @Override\n protected boolean checkOperation() {\n return false;\n }\n}\n","subject":"Select item dont check for operation existance"} {"old_contents":"package ch.hevs.aislab.magpie.test.java;\n\n\nimport org.junit.Test;\n\nimport alice.tuprolog.Term;\nimport ch.hevs.aislab.magpie.event.LogicTupleEvent;\n\nimport static junit.framework.TestCase.assertEquals;\n\npublic class LogicTupleTest {\n\n @Test\n public void createLogicTuple() {\n\n \/\/ This method tests if the following LogicTuple is created correctly using the different constructors\n final String logicTuple = \"blood_pressure(Sys,Dias)\";\n\n \/\/ Creation with multiple arguments\n LogicTupleEvent bp1 = new LogicTupleEvent(\"blood_pressure\", \"Sys\", \"Dias\");\n String tupleFromArgs = bp1.toTuple();\n assertEquals(logicTuple, tupleFromArgs);\n\n \/\/ Creation from a tuProlog Term\n Term t = Term.createTerm(logicTuple);\n LogicTupleEvent bp2 = new LogicTupleEvent(t);\n String tupleFromTerm = bp2.toTuple();\n assertEquals(logicTuple, tupleFromTerm);\n\n \/\/ Creation from String\n LogicTupleEvent bp3 = new LogicTupleEvent(logicTuple);\n String tupleFromString = bp3.toTuple();\n assertEquals(logicTuple, tupleFromString);\n }\n}\n","new_contents":"package ch.hevs.aislab.magpie.test.java;\n\n\nimport org.junit.Test;\n\nimport alice.tuprolog.Term;\nimport ch.hevs.aislab.magpie.event.LogicTupleEvent;\n\nimport static junit.framework.TestCase.assertEquals;\n\npublic class LogicTupleTest {\n\n @Test\n public void createLogicTuple() {\n\n \/\/ This method tests if the following LogicTuple is created correctly using the different constructors\n final String logicTuple = \"blood_pressure(Sys,Dias)\";\n\n \/\/ Creation with multiple arguments\n LogicTupleEvent bp1 = new LogicTupleEvent(\"blood_pressure\", \"Sys\", \"Dias\");\n String tupleFromArgs = bp1.toTuple();\n assertEquals(logicTuple, tupleFromArgs);\n\n \/\/ Creation from a tuProlog Term\n Term t = Term.createTerm(logicTuple);\n LogicTupleEvent bp2 = new LogicTupleEvent(t);\n String tupleFromTerm = bp2.toTuple();\n assertEquals(logicTuple, tupleFromTerm);\n\n \/\/ Creation from String\n LogicTupleEvent bp3 = new LogicTupleEvent(logicTuple);\n String tupleFromString = bp3.toTuple();\n assertEquals(logicTuple, tupleFromString);\n }\n\n @Test\n public void getNameAndArguments() {\n\n String name = \"blood_pressure\";\n String arg1 = \"Sys\";\n String arg2 = \"Dias\";\n LogicTupleEvent ev = new LogicTupleEvent(name, arg1, arg2);\n\n assertEquals(name, ev.getName());\n assertEquals(arg1, ev.getArguments().get(0));\n assertEquals(arg2, ev.getArguments().get(1));\n }\n}\n","subject":"Add test that checks whether the name and the arguments are correct"} {"old_contents":"\/**\n * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies\n * \n * Please see distribution for license.\n *\/\npackage com.opengamma.engine.view.calc;\n\nimport com.opengamma.core.change.ChangeEvent;\nimport com.opengamma.core.change.ChangeListener;\n\n\/**\n * Change listener for a single view definition which notifies a computation job.\n *\/\npublic class ViewDefinitionChangeListener implements ChangeListener {\n\n private final ViewComputationJob _computationJob;\n private final String _viewDefinitionName;\n \n public ViewDefinitionChangeListener(ViewComputationJob computationJob, String viewDefinitionName) {\n _computationJob = computationJob;\n _viewDefinitionName = viewDefinitionName;\n }\n \n @Override\n public void entityChanged(ChangeEvent event) {\n if (event.getAfterId() == null) {\n \/\/ View definition could have been deleted - do we want to stop the process?\n return;\n }\n if (event.getBeforeId().getValue().equals(getViewDefinitionName())) {\n getViewComputationJob().dirtyViewDefinition();\n }\n }\n \n private String getViewDefinitionName() {\n return _viewDefinitionName;\n }\n \n private ViewComputationJob getViewComputationJob() {\n return _computationJob;\n }\n \n}\n","new_contents":"\/**\n * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies\n * \n * Please see distribution for license.\n *\/\npackage com.opengamma.engine.view.calc;\n\nimport com.opengamma.core.change.ChangeEvent;\nimport com.opengamma.core.change.ChangeListener;\n\n\/**\n * Change listener for a single view definition which notifies a computation job.\n *\/\npublic class ViewDefinitionChangeListener implements ChangeListener {\n\n private final ViewComputationJob _computationJob;\n private final String _viewDefinitionName;\n \n public ViewDefinitionChangeListener(ViewComputationJob computationJob, String viewDefinitionName) {\n _computationJob = computationJob;\n _viewDefinitionName = viewDefinitionName;\n }\n \n @Override\n public void entityChanged(ChangeEvent event) {\n if (event.getBeforeId() == null) {\n \/\/ View definition created \n return;\n }\n if (event.getAfterId() == null) {\n \/\/ View definition could have been deleted - do we want to stop the process?\n return;\n }\n if (event.getBeforeId().getValue().equals(getViewDefinitionName())) {\n getViewComputationJob().dirtyViewDefinition();\n }\n }\n \n private String getViewDefinitionName() {\n return _viewDefinitionName;\n }\n \n private ViewComputationJob getViewComputationJob() {\n return _computationJob;\n }\n \n}\n","subject":"Stop throwing when view definition is created"} {"old_contents":"package me.nallar.patched.storage;\r\n\r\nimport me.nallar.tickthreading.patcher.Declare;\r\nimport net.minecraft.nbt.NBTTagCompound;\r\nimport net.minecraft.world.ChunkCoordIntPair;\r\nimport net.minecraft.world.chunk.storage.AnvilChunkLoaderPending;\r\n\r\n\/**\r\n * This patch class doesn't change anything, it's just here so the prepatcher will\r\n * make AnvilChunkLoaderPending public\r\n *\/\r\npublic abstract class PatchAnvilChunkLoaderPending extends AnvilChunkLoaderPending {\r\n\t@Declare\r\n\tpublic boolean unloading_;\r\n\r\n\tpublic PatchAnvilChunkLoaderPending(ChunkCoordIntPair par1ChunkCoordIntPair, NBTTagCompound par2NBTTagCompound) {\r\n\t\tsuper(par1ChunkCoordIntPair, par2NBTTagCompound);\r\n\t}\r\n}\r\n","new_contents":"package me.nallar.patched.storage;\r\n\r\nimport me.nallar.tickthreading.patcher.Declare;\r\nimport net.minecraft.nbt.NBTTagCompound;\r\nimport net.minecraft.world.ChunkCoordIntPair;\r\nimport net.minecraft.world.chunk.storage.AnvilChunkLoaderPending;\r\n\r\npublic abstract class PatchAnvilChunkLoaderPending extends AnvilChunkLoaderPending {\r\n\t@Declare\r\n\tpublic boolean unloading_;\r\n\r\n\tpublic PatchAnvilChunkLoaderPending(ChunkCoordIntPair par1ChunkCoordIntPair, NBTTagCompound par2NBTTagCompound) {\r\n\t\tsuper(par1ChunkCoordIntPair, par2NBTTagCompound);\r\n\t}\r\n}\r\n","subject":"Remove no longer valid comment for AnvilChunkLoaderPending"} {"old_contents":"\/*\n * Copyright (c) 2005-2010 Grameen Foundation USA\n * All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n * implied. See the License for the specific language governing\n * permissions and limitations under the License.\n *\n * See also http:\/\/www.apache.org\/licenses\/LICENSE-2.0.html for an\n * explanation of the license and how it is applied.\n *\/\npackage org.mifos.ui.core.controller;\n\npublic class SectionForm {\n private String name;\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n}\n","new_contents":"\/*\n * Copyright (c) 2005-2010 Grameen Foundation USA\n * All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n * implied. See the License for the specific language governing\n * permissions and limitations under the License.\n *\n * See also http:\/\/www.apache.org\/licenses\/LICENSE-2.0.html for an\n * explanation of the license and how it is applied.\n *\/\npackage org.mifos.ui.core.controller;\n\nimport java.io.Serializable;\n\npublic class SectionForm implements Serializable {\n private static final long serialVersionUID = 4707282409987816335L;\n private String name;\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n}\n","subject":"Add sections to Question Group"} {"old_contents":"package io.github.proxyprint.kitchen.controllers.printshops;\n\nimport com.google.gson.Gson;\nimport com.google.gson.GsonBuilder;\nimport com.google.gson.JsonObject;\nimport io.github.proxyprint.kitchen.models.printshops.PrintShop;\nimport io.github.proxyprint.kitchen.models.printshops.pricetable.PaperTableItem;\nimport io.github.proxyprint.kitchen.models.repositories.PrintShopDAO;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\n\/**\n * Created by daniel on 27-04-2016.\n *\/\n@RestController\npublic class ManagerController {\n\n @Autowired\n private PrintShopDAO printshops;\n private final static Gson GSON = new GsonBuilder().setPrettyPrinting().create();\n\n @RequestMapping(value = \"\/printshops\/{id}\/pricetable\/newpaperitem\", method = RequestMethod.POST)\n public String registerRequest(@PathVariable(value = \"id\") long id, @RequestBody PaperTableItem pti) {\n PrintShop pshop = printshops.findOne(id);\n JsonObject response = new JsonObject();\n\n if(pshop!=null) {\n pshop.insertPaperItemsInPriceTable(pti);\n printshops.save(pshop);\n response.addProperty(\"success\", true);\n return GSON.toJson(response);\n }\n else{\n response.addProperty(\"success\", false);\n return GSON.toJson(response);\n }\n }\n}\n","new_contents":"package io.github.proxyprint.kitchen.controllers.printshops;\n\nimport com.google.gson.Gson;\nimport com.google.gson.GsonBuilder;\nimport com.google.gson.JsonObject;\nimport io.github.proxyprint.kitchen.models.printshops.PrintShop;\nimport io.github.proxyprint.kitchen.models.printshops.pricetable.PaperTableItem;\nimport io.github.proxyprint.kitchen.models.repositories.PrintShopDAO;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\n\/**\n * Created by daniel on 27-04-2016.\n *\/\n@RestController\npublic class ManagerController {\n\n @Autowired\n private PrintShopDAO printshops;\n private final static Gson GSON = new GsonBuilder().setPrettyPrinting().create();\n\n @RequestMapping(value = \"\/printshops\/{id}\/pricetable\/newpaperitem\", method = RequestMethod.POST)\n public String addNewPaperItem(@PathVariable(value = \"id\") long id, @RequestBody PaperTableItem pti) {\n PrintShop pshop = printshops.findOne(id);\n JsonObject response = new JsonObject();\n\n if(pshop!=null) {\n pshop.insertPaperItemsInPriceTable(pti);\n printshops.save(pshop);\n response.addProperty(\"success\", true);\n return GSON.toJson(response);\n }\n else{\n response.addProperty(\"success\", false);\n return GSON.toJson(response);\n }\n }\n}\n","subject":"Add new entry in pricetable Print&Copy section."} {"old_contents":"\/\/ Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\npackage com.yahoo.config.provision.security;\n\nimport java.security.cert.X509Certificate;\nimport java.util.List;\n\n\/**\n * Identifies Vespa nodes from the their X509 certificate.\n *\n * @author bjorncs\n *\/\npublic interface NodeIdentifier {\n\n NodeIdentity identifyNode(List peerCertificateChain);\n\n}\n","new_contents":"\/\/ Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\npackage com.yahoo.config.provision.security;\n\nimport java.security.cert.X509Certificate;\nimport java.util.List;\n\n\/**\n * Identifies Vespa nodes from the their X509 certificate.\n *\n * @author bjorncs\n *\/\npublic interface NodeIdentifier {\n\n NodeIdentity identifyNode(List peerCertificateChain) throws NodeIdentifierException;\n\n}\n","subject":"Add throws definition to 'identityNode'"} {"old_contents":"\/******************************************************************\n * File: MapSource.java\n * Created by: Dave Reynolds\n * Created on: 13 Dec 2013\n * \n * (c) Copyright 2013, Epimorphics Limited\n *\n *****************************************************************\/\n\npackage com.epimorphics.dclib.framework;\n\nimport org.apache.jena.riot.system.StreamRDF;\n\nimport com.hp.hpl.jena.graph.Node;\n\n\/**\n * Signature for utilities the support mapping of input values \n * to normalized RDF values (normally URIs).\n * \n * @author Dave Reynolds<\/a>\n *\/\npublic interface MapSource {\n\n \/**\n * Return the matching normalized RDF value or none if there no\n * match (or no unambiguous match)\n *\/\n public Node lookup(String key);\n \n \n \/**\n * Return the name of this suorce, may be null\n *\/\n public String getName();\n \n \/**\n * Enrich the RDF outstream from other properties of a matched node\n *\/\n public void enrich(StreamRDF stream, Node match);\n}\n","new_contents":"\/******************************************************************\n * File: MapSource.java\n * Created by: Dave Reynolds\n * Created on: 13 Dec 2013\n * \n * (c) Copyright 2013, Epimorphics Limited\n *\n *****************************************************************\/\n\npackage com.epimorphics.dclib.framework;\n\nimport org.apache.jena.riot.system.StreamRDF;\n\nimport com.epimorphics.appbase.monitor.ConfigInstance;\nimport com.hp.hpl.jena.graph.Node;\n\n\/**\n * Signature for utilities the support mapping of input values \n * to normalized RDF values (normally URIs).\n * \n * @author Dave Reynolds<\/a>\n *\/\npublic interface MapSource extends ConfigInstance {\n\n \/**\n * Return the matching normalized RDF value or none if there no\n * match (or no unambiguous match)\n *\/\n public Node lookup(String key);\n \n \n \/**\n * Return the name of this suorce, may be null\n *\/\n public String getName();\n \n \/**\n * Enrich the RDF outstream from other properties of a matched node\n *\/\n public void enrich(StreamRDF stream, Node match);\n}\n","subject":"Change signature so sources can be treated as configurable items"} {"old_contents":"package models;\n\nimport java.util.List;\nimport java.util.UUID;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\n\n\/**\n * The base class for all of the models used by GTFS Data Manager.\n * We don't use the Play model object because we're not saving things to a relational database.\n * @author mattwigway\n *\/\npublic abstract class Model {\n \n public Model () {\n this.id = UUID.randomUUID().toString();\n }\n \n public String id;\n \n \/**\n * The ID of the user who owns this object.\n * For accountability, every object is owned by a user.\n *\/\n @JsonIgnore\n public String userId;\n \n \/**\n * Notes on this object\n *\/\n public List notes;\n \n \/**\n * Get the user who owns this object.\n * @return the User object\n *\/\n public User getUser () {\n return User.getUser(userId);\n }\n \n \/**\n * Set the owner of this object\n *\/\n public void setUser (User user) {\n userId = user.id != null ? user.id : User.getUserId(user.username);\n }\n}\n","new_contents":"package models;\n\nimport java.util.List;\nimport java.util.UUID;\n\nimport javax.persistence.MappedSuperclass;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\n\n\/**\n * The base class for all of the models used by GTFS Data Manager.\n * We don't use the Play model object because we're not saving things to a relational database.\n * @author mattwigway\n *\/\n@MappedSuperclass\npublic abstract class Model {\n \n public Model () {\n this.id = UUID.randomUUID().toString();\n }\n \n public String id;\n \n \/**\n * The ID of the user who owns this object.\n * For accountability, every object is owned by a user.\n *\/\n @JsonIgnore\n public String userId;\n \n \/**\n * Notes on this object\n *\/\n public List notes;\n \n \/**\n * Get the user who owns this object.\n * @return the User object\n *\/\n public User getUser () {\n return User.getUser(userId);\n }\n \n \/**\n * Set the owner of this object\n *\/\n public void setUser (User user) {\n userId = user.id != null ? user.id : User.getUserId(user.username);\n }\n}\n","subject":"Add @MappedSuperclass so user information is serialized."} {"old_contents":"package org.realityforge.replicant.server.ee.rest;\n\nimport javax.inject.Inject;\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.Produces;\nimport javax.ws.rs.core.MediaType;\nimport org.realityforge.replicant.shared.transport.ReplicantContext;\nimport org.realityforge.ssf.SessionManager;\n\n\/**\n * The token source is for generating the initial token.\n *\n * It is expected that this endpoint has already had security applied.\n *\/\n@Path( ReplicantContext.TOKEN_URL_FRAGMENT )\n@Produces( MediaType.TEXT_PLAIN )\npublic class TokenRestService\n{\n @Inject\n private SessionManager _sessionManager;\n\n @GET\n public String generateToken()\n {\n return _sessionManager.createSession().getSessionID();\n }\n}\n","new_contents":"package org.realityforge.replicant.server.ee.rest;\n\nimport javax.ejb.EJB;\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.Produces;\nimport javax.ws.rs.core.MediaType;\nimport org.realityforge.replicant.shared.transport.ReplicantContext;\nimport org.realityforge.ssf.SessionManager;\n\n\/**\n * The token source is for generating the initial token.\n *\n * It is expected that this endpoint has already had security applied.\n *\/\n@Path( ReplicantContext.TOKEN_URL_FRAGMENT )\n@Produces( MediaType.TEXT_PLAIN )\npublic class TokenRestService\n{\n @EJB\n private SessionManager _sessionManager;\n\n @GET\n public String generateToken()\n {\n return _sessionManager.createSession().getSessionID();\n }\n}\n","subject":"Use an @EJB annotation to comply with Domgen generated code"} {"old_contents":"package com.kilfat.web.model.deserializer;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.kilfat.config.ServiceConstants;\n\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\n\npublic class DeserializerHelper {\n private static final SimpleDateFormat dateFormat = new SimpleDateFormat(ServiceConstants.DATE_FORMAT);\n\n public static JsonNode getFieldNode(JsonNode node, String field) {\n if (node.get(field) != null) {\n return node.get(field);\n }\n return null;\n }\n\n public static String getField(JsonNode node, String field) {\n if (node.get(field) != null) {\n return node.get(field).textValue();\n }\n return \"\";\n }\n\n public static Integer getIntegerField(JsonNode node, String field) {\n if (node.get(field) != null) {\n return node.get(field).intValue();\n }\n return null;\n }\n\n public static Long getLongField(JsonNode node, String field) {\n if (node.get(field) != null) {\n return node.get(field).longValue();\n }\n return null;\n }\n\n public static Date getDateField(JsonNode node, String field) {\n String dateAsString;\n if (node.get(field) == null) {\n return null;\n }\n dateAsString = node.get(field).textValue();\n try {\n return dateFormat.parse(dateAsString);\n } catch (ParseException e) {\n throw new RuntimeException(e);\n }\n }\n}\n","new_contents":"package com.kilfat.web.model.deserializer;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.kilfat.config.ServiceConstants;\n\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\n\npublic class DeserializerHelper {\n private static final SimpleDateFormat dateFormat = new SimpleDateFormat(ServiceConstants.DATE_FORMAT);\n\n public static JsonNode getFieldNode(JsonNode node, String field) {\n if (node.get(field) != null) {\n return node.get(field);\n }\n return null;\n }\n\n public static String getField(JsonNode node, String field) {\n if (node.get(field) != null) {\n return node.get(field).textValue();\n }\n return \"\";\n }\n\n public static Integer getIntegerField(JsonNode node, String field) {\n if (node.get(field) != null) {\n return node.get(field).intValue();\n }\n return null;\n }\n\n public static Long getLongField(JsonNode node, String field) {\n if (node.get(field) != null) {\n return node.get(field).longValue();\n }\n return null;\n }\n\n public static Date getDateField(JsonNode node, String field) {\n long date;\n if (node.get(field) == null || node.get(field).isLong() == false) {\n return null;\n }\n date = node.get(field).asLong();\n try {\n return dateFormat.parse(date*1000L);\n } catch (ParseException e) {\n throw new RuntimeException(e);\n }\n }\n}\n","subject":"Change data parser, need to add unix timestamp support"} {"old_contents":"package fape.core.planning.search.strategies.flaws;\n\nimport fape.core.planning.planner.Planner;\nimport fape.core.planning.search.flaws.flaws.Flaw;\nimport fape.core.planning.search.flaws.flaws.UnmotivatedAction;\nimport fape.core.planning.search.flaws.flaws.UnrefinedTask;\nimport fape.core.planning.states.State;\n\npublic class HierarchicalFirstComp implements FlawComparator {\n\n public final State st;\n public final Planner planner;\n\n public HierarchicalFirstComp(State st, Planner planner) {\n this.st = st;\n this.planner = planner;\n }\n\n @Override\n public String shortName() {\n return \"hf\";\n }\n\n private int priority(Flaw flaw) {\n if(flaw instanceof UnrefinedTask)\n return 3;\n else if(flaw instanceof UnmotivatedAction)\n return 4;\n else\n return 5;\n }\n\n\n @Override\n public int compare(Flaw o1, Flaw o2) {\n return priority(o1) - priority(o2);\n }\n}\n","new_contents":"package fape.core.planning.search.strategies.flaws;\n\nimport fape.core.planning.planner.Planner;\nimport fape.core.planning.search.flaws.flaws.Flaw;\nimport fape.core.planning.search.flaws.flaws.Threat;\nimport fape.core.planning.search.flaws.flaws.UnmotivatedAction;\nimport fape.core.planning.search.flaws.flaws.UnrefinedTask;\nimport fape.core.planning.states.State;\n\npublic class HierarchicalFirstComp implements FlawComparator {\n\n public final State st;\n public final Planner planner;\n public final boolean threatsFirst;\n\n public HierarchicalFirstComp(State st, Planner planner) {\n this.st = st;\n this.planner = planner;\n threatsFirst = st.pb.allActionsAreMotivated();\n }\n\n @Override\n public String shortName() {\n return \"hf\";\n }\n\n private double priority(Flaw flaw) {\n if(threatsFirst && flaw instanceof Threat)\n return 0.;\n else if(flaw instanceof UnrefinedTask)\n return 1. + ((double) st.getEarliestStartTime(((UnrefinedTask) flaw).task.start())) \/ ((double) st.getEarliestStartTime(st.pb.end())+1);\n else if(flaw instanceof UnmotivatedAction)\n return 4.;\n else\n return 5.;\n }\n\n\n @Override\n public int compare(Flaw o1, Flaw o2) {\n return (int) Math.signum(priority(o1) - priority(o2));\n }\n}\n","subject":"Update default flaw selection strategy on hierarchical domains: threats first, then unrefined tasks."} {"old_contents":"package com.example.spring.config;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.web.servlet.resource.VersionPathStrategy;\n\n@Slf4j\npublic class MiddleVersionPathStrategy implements VersionPathStrategy {\n private final String prefix;\n private final String version;\n\n public MiddleVersionPathStrategy(String prefix, String version) {\n this.prefix = prefix;\n this.version = version;\n }\n\n @Override\n public String extractVersion(String requestPath) {\n if (requestPath.startsWith(this.prefix)) {\n String prefixRemoved = requestPath.substring(this.prefix.length());\n if (prefixRemoved.startsWith(this.version)) {\n return this.version;\n }\n }\n return null;\n }\n\n @Override\n public String removeVersion(String requestPath, String version) {\n return requestPath.substring(this.prefix.length()).substring(this.version.length());\n }\n\n @Override\n public String addVersion(String path, String version) {\n log.info(\"addVersion: {}\", path);\n if (path.startsWith(\".\")) {\n return path;\n } else {\n return (path.startsWith(\"\/\") ? this.prefix + this.version + path : this.prefix + this.version + \"\/\" + path);\n }\n }\n}\n","new_contents":"package com.example.spring.config;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.web.servlet.resource.VersionPathStrategy;\n\n@Slf4j\npublic class MiddleVersionPathStrategy implements VersionPathStrategy {\n private final String prefix;\n private final String version;\n\n public MiddleVersionPathStrategy(String prefix, String version) {\n this.prefix = prefix;\n this.version = version;\n }\n\n @Override\n public String extractVersion(String requestPath) {\n if (requestPath.startsWith(this.prefix)) {\n String prefixRemoved = requestPath.substring(this.prefix.length());\n if (prefixRemoved.startsWith(this.version)) {\n return this.version;\n }\n }\n return null;\n }\n\n @Override\n public String removeVersion(String requestPath, String version) {\n return this.prefix + requestPath.substring(this.prefix.length() + this.version.length());\n }\n\n @Override\n public String addVersion(String path, String version) {\n log.info(\"addVersion: {}\", path);\n if (path.startsWith(\".\")) {\n return path;\n } else {\n String p = path;\n if (p.startsWith(\"\/\")) {\n p = p.substring(1);\n }\n if (p.startsWith(this.prefix)) {\n return this.prefix + this.version + \"\/\" + p.substring(this.prefix.length());\n } else {\n return path;\n }\n }\n }\n}\n","subject":"Fix fixed version example to handle prefix correctly"} {"old_contents":"package com.futurice.rctaudiotoolkit;\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class AudioPackage implements ReactPackage {\n @Override\n public List createNativeModules(ReactApplicationContext reactContext) {\n List modules = new ArrayList<>();\n modules.add(new AudioRecorderModule(reactContext));\n modules.add(new AudioPlayerModule(reactContext));\n return modules;\n }\n\n @Override\n public List> createJSModules() {\n return Collections.emptyList();\n }\n\n @Override\n public List createViewManagers(ReactApplicationContext reactContext) {\n return Collections.emptyList();\n }\n}\n","new_contents":"package com.futurice.rctaudiotoolkit;\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class AudioPackage implements ReactPackage {\n @Override\n public List createNativeModules(ReactApplicationContext reactContext) {\n List modules = new ArrayList<>();\n modules.add(new AudioRecorderModule(reactContext));\n modules.add(new AudioPlayerModule(reactContext));\n return modules;\n }\n\n \/\/ Deprecated in RN 0.47\n public List> createJSModules() {\n return Collections.emptyList();\n }\n\n @Override\n public List createViewManagers(ReactApplicationContext reactContext) {\n return Collections.emptyList();\n }\n}\n","subject":"Allow compatibility with RN 0.47"} {"old_contents":"package org.apache.hadoop.hive.ql.io.parquet.timestamp;\n\nimport org.apache.hadoop.hive.common.type.Timestamp;\n\nimport static java.lang.Math.toIntExact;\nimport static java.util.concurrent.TimeUnit.SECONDS;\n\npublic final class NanoTimeUtils\n{\n private NanoTimeUtils() {}\n\n private static final int JULIAN_EPOCH_OFFSET_DAYS = 2_440_588;\n\n public static NanoTime getNanoTime(Timestamp timestamp, @SuppressWarnings(\"unused\") boolean ignored)\n {\n int epochDay = toIntExact(SECONDS.toDays(timestamp.toEpochSecond()));\n int julianDay = JULIAN_EPOCH_OFFSET_DAYS + epochDay;\n\n long timeOfDaySeconds = timestamp.toEpochSecond() % 86400;\n long timeOfDayNanos = SECONDS.toNanos(timeOfDaySeconds) + timestamp.getNanos();\n\n return new NanoTime(julianDay, timeOfDayNanos);\n }\n}\n","new_contents":"package org.apache.hadoop.hive.ql.io.parquet.timestamp;\n\nimport org.apache.hadoop.hive.common.type.Timestamp;\n\nimport static java.lang.Math.floorDiv;\nimport static java.lang.Math.floorMod;\nimport static java.lang.Math.toIntExact;\nimport static java.util.concurrent.TimeUnit.SECONDS;\n\npublic final class NanoTimeUtils\n{\n private NanoTimeUtils() {}\n\n private static final int JULIAN_EPOCH_OFFSET_DAYS = 2_440_588;\n private static final long SECONDS_PER_DAY = 86400L;\n\n public static NanoTime getNanoTime(Timestamp timestamp, @SuppressWarnings(\"unused\") boolean ignored)\n {\n long epochSeconds = timestamp.toEpochSecond();\n int epochDay = toIntExact(floorDiv(epochSeconds, SECONDS_PER_DAY));\n int julianDay = JULIAN_EPOCH_OFFSET_DAYS + epochDay;\n\n long timeOfDaySeconds = floorMod(epochSeconds, SECONDS_PER_DAY);\n long timeOfDayNanos = SECONDS.toNanos(timeOfDaySeconds) + timestamp.getNanos();\n\n return new NanoTime(julianDay, timeOfDayNanos);\n }\n}\n","subject":"Fix Parquet encoding for timestamps before epoch"} {"old_contents":"package org.realityforge.replicant.shared.transport;\n\npublic class ReplicantContext\n{\n \/**\n * Key used to retrieve an opaque identifier for the session from the ReplicantContextHolder.\n * Used to pass data from the servlet to the EJB.\n *\/\n public static final String SESSION_ID_KEY = \"SessionID\";\n \/**\n * Key used to retrieve an opaque identifier for the request from the ReplicantContextHolder.\n * Used to pass data from the servlet to the EJB.\n *\/\n public static final String REQUEST_ID_KEY = \"RequestID\";\n \/**\n * Key used to retrieve a flag whether the request produced a changeset relevant for the initiating session..\n * Used to pass data from the EJB to the servlet.\n *\/\n public static final String REQUEST_COMPLETE_KEY = \"RequestComplete\";\n\n \/**\n * HTTP request header to indicate the session id.\n *\/\n public static final String SESSION_ID_HEADER = \"X-GWT-SessionID\";\n \/**\n * HTTP request header to indicate the request id.\n *\/\n public static final String REQUEST_ID_HEADER = \"X-GWT-RequestID\";\n \/**\n * HTTP response header to indicate the whether the request is complete or a change set is expected.\n *\/\n public static final String REQUEST_COMPLETE_HEADER = \"X-GWT-RequestComplete\";\n}\n","new_contents":"package org.realityforge.replicant.shared.transport;\n\npublic final class ReplicantContext\n{\n \/**\n * Key used to retrieve an opaque identifier for the session from the ReplicantContextHolder.\n * Used to pass data from the servlet to the EJB.\n *\/\n public static final String SESSION_ID_KEY = \"SessionID\";\n \/**\n * Key used to retrieve an opaque identifier for the request from the ReplicantContextHolder.\n * Used to pass data from the servlet to the EJB.\n *\/\n public static final String REQUEST_ID_KEY = \"RequestID\";\n \/**\n * Key used to retrieve a flag whether the request produced a changeset relevant for the initiating session..\n * Used to pass data from the EJB to the servlet.\n *\/\n public static final String REQUEST_COMPLETE_KEY = \"RequestComplete\";\n\n \/**\n * HTTP request header to indicate the session id.\n *\/\n public static final String SESSION_ID_HEADER = \"X-GWT-SessionID\";\n \/**\n * HTTP request header to indicate the request id.\n *\/\n public static final String REQUEST_ID_HEADER = \"X-GWT-RequestID\";\n \/**\n * HTTP response header to indicate the whether the request is complete or a change set is expected.\n *\/\n public static final String REQUEST_COMPLETE_HEADER = \"X-GWT-RequestComplete\";\n\n private ReplicantContext()\n {\n }\n}\n","subject":"Make sure you can not instantiate class"} {"old_contents":"package devopsdistilled.operp.server.data.service;\n\nimport java.io.Serializable;\n\nimport org.springframework.data.jpa.repository.JpaRepository;\n\npublic interface EntityService extends\n\t\tJpaRepository, Serializable {\n\n}\n","new_contents":"package devopsdistilled.operp.server.data.service;\n\nimport java.io.Serializable;\n\nimport org.springframework.data.jpa.repository.JpaRepository;\n\nimport devopsdistilled.operp.server.data.entity.Entiti;\n\npublic interface EntityService extends\n\t\tJpaRepository, Serializable {\n\n}\n","subject":"Change argument type to \"E extends Entiti\" instead of \"T\""} {"old_contents":"\/*\n * Copyright 2017 Axway Software\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.axway.ats.log.autodb.events;\n\nimport org.apache.log4j.Logger;\n\nimport com.axway.ats.log.autodb.LifeCycleState;\nimport com.axway.ats.log.autodb.model.AbstractLoggingEvent;\nimport com.axway.ats.log.autodb.model.LoggingEventType;\n\n@SuppressWarnings( \"serial\")\npublic class EndAfterClassEvent extends AbstractLoggingEvent {\n\n public EndAfterClassEvent( String loggerFQCN, Logger logger ) {\n super(loggerFQCN, logger, \"End after class execution\", LoggingEventType.END_AFTER_CLASS);\n }\n\n @Override\n protected LifeCycleState getExpectedLifeCycleState( LifeCycleState state ) {\n\n return LifeCycleState.ATLEAST_RUN_STARTED;\n }\n\n}\n","new_contents":"\/*\n * Copyright 2017 Axway Software\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.axway.ats.log.autodb.events;\n\nimport org.apache.log4j.Logger;\n\nimport com.axway.ats.log.autodb.LifeCycleState;\nimport com.axway.ats.log.autodb.model.AbstractLoggingEvent;\nimport com.axway.ats.log.autodb.model.LoggingEventType;\n\n@SuppressWarnings( \"serial\")\npublic class EndAfterClassEvent extends AbstractLoggingEvent {\n\n public EndAfterClassEvent( String loggerFQCN, Logger logger ) {\n super(loggerFQCN, logger, \"End after class execution\", LoggingEventType.END_AFTER_CLASS);\n }\n\n @Override\n protected LifeCycleState getExpectedLifeCycleState( LifeCycleState state ) {\n \/* This event is fired after a suite is already closed,\n since ATS (AtsTestngListener) could not be certain that @AfterClass will be available\n *\/\n return LifeCycleState.ATLEAST_RUN_STARTED;\n }\n\n}\n","subject":"Add comment for event state"} {"old_contents":"package edu.msudenver.cs3250.group6.msubanner.entities;\n\nimport javax.persistence.Column;\nimport javax.persistence.GeneratedValue;\nimport javax.persistence.GenerationType;\nimport javax.persistence.Id;\n\n\/**\n * Student class.\n *\/\npublic final class Student extends User {\n\n \/** The student id. *\/\n @Id\n @GeneratedValue(strategy = GenerationType.AUTO)\n @Column(unique = true)\n private String id;\n\n \/**\n * Default constructor.\n *\/\n public Student() { }\n\n \/**\n * Constructor.\n * @param firstName Student's first name\n * @param lastName Student's last name\n *\/\n public Student(final String firstName, final String lastName) {\n super(firstName, lastName);\n }\n\n @Override\n public boolean equals(final Object other) {\n return other instanceof Student && super.equals(other);\n }\n}\n","new_contents":"package edu.msudenver.cs3250.group6.msubanner.entities;\n\nimport javax.persistence.Column;\nimport javax.persistence.GeneratedValue;\nimport javax.persistence.GenerationType;\nimport javax.persistence.Id;\n\n\/**\n * Student class.\n *\/\npublic final class Student extends User {\n\n \/** The student id. *\/\n @Id\n @GeneratedValue(strategy = GenerationType.AUTO)\n @Column(unique = true)\n private String id;\n\n \/**\n * Default constructor.\n *\/\n public Student() { }\n \n \/**\n * Constructor.\n * @param firstName Student's first name\n * @param lastName Student's last name\n *\/\n public Student(final String firstName, final String lastName) {\n super(firstName, lastName);\n }\n\n @Override\n public boolean equals(final Object other) {\n return other instanceof Student && super.equals(other);\n }\n}\n","subject":"Test coverage at 90% for student and professor"} {"old_contents":"package org.bouncycastle.util.test;\n\nimport java.io.FilterOutputStream;\nimport java.io.IOException;\nimport java.io.OutputStream;\n\npublic class UncloseableOutputStream extends FilterOutputStream\n{\n public UncloseableOutputStream(OutputStream s)\n {\n super(s);\n }\n\n public void close()\n {\n throw new RuntimeException(\"close() called on UncloseableOutputStream\");\n }\n\n public void write(byte[] b, int off, int len) throws IOException\n {\n out.write(b, off, len);\n }\n }\n","new_contents":"package org.bouncycastle.util.test;\n\nimport java.io.FilterOutputStream;\nimport java.io.IOException;\nimport java.io.OutputStream;\n\n\/**\n * This is a testing utility class to check the property that an {@link OutputStream} is never\n * closed in some particular context - typically when wrapped by another {@link OutputStream} that\n * should not be forwarding its {@link OutputStream#close()} calls. Not needed in production code.\n *\/\npublic class UncloseableOutputStream extends FilterOutputStream\n{\n public UncloseableOutputStream(OutputStream s)\n {\n super(s);\n }\n\n public void close()\n {\n throw new RuntimeException(\"close() called on UncloseableOutputStream\");\n }\n\n public void write(byte[] b, int off, int len) throws IOException\n {\n out.write(b, off, len);\n }\n }\n","subject":"Add javadoc to make clear this is for testing only"} {"old_contents":"package me.pagar;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic enum BankAccountType {\n @SerializedName(\"conta_corrente\")\n CONTA_CORRENTE,\n @SerializedName(\"conta_poupanca\")\n CONTA_POUPANCA,\n @SerializedName(\"conta_corrente_conjunta\")\n CONTA_CORRENTE_CONJUNTA,\n @SerializedName(\"conta_poupanca_conjunta\")\n CONTA_POUPANCA_CONJUNTA\n}\n","new_contents":"package me.pagar;\n\nimport com.google.gson.annotations.SerializedName;\n\npublic enum BankAccountType {\n @SerializedName(\"conta_corrente\")\n CORRENTE,\n @SerializedName(\"conta_poupanca\")\n POUPANCA,\n @SerializedName(\"conta_corrente_conjunta\")\n CORRENTE_CONJUNTA,\n @SerializedName(\"conta_poupanca_conjunta\")\n POUPANCA_CONJUNTA\n}\n","subject":"Remove CONTA_ from BankAccountTyp enum values as requested"} {"old_contents":"\/*\n * Copyright 2014 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\n\/**\n * Defines tools that can build things that run on the JVM.\n *\/\n@org.gradle.api.Incubating\n@NonNullApi\npackage org.gradle.jvm.toolchain;\n\nimport org.gradle.api.NonNullApi;\n","new_contents":"\/*\n * Copyright 2014 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\n\/**\n * Defines tools that can build things that run on the JVM.\n *\/\n@NonNullApi\npackage org.gradle.jvm.toolchain;\n\nimport org.gradle.api.NonNullApi;\n","subject":"Remove Incubating annotation from toolchain package"} {"old_contents":"\/*\n * Copyright 2016-2017 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\/\n\npackage com.github.blindpirate.gogradle.task;\n\nimport org.gradle.api.DefaultTask;\nimport org.gradle.api.Task;\n\nimport javax.inject.Inject;\n\npublic class AbstractGolangTask extends DefaultTask {\n @Inject\n private GolangTaskContainer golangTaskContainer;\n\n protected T getTask(Class clazz) {\n return golangTaskContainer.get(clazz);\n }\n}\n","new_contents":"\/*\n * Copyright 2016-2017 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\/\n\npackage com.github.blindpirate.gogradle.task;\n\nimport org.gradle.api.DefaultTask;\nimport org.gradle.api.Task;\n\nimport javax.inject.Inject;\n\npublic class AbstractGolangTask extends DefaultTask {\n @Inject\n private GolangTaskContainer golangTaskContainer;\n\n public AbstractGolangTask() {\n setGroup(\"Gogradle\");\n }\n\n protected T getTask(Class clazz) {\n return golangTaskContainer.get(clazz);\n }\n}\n","subject":"Set group for go tasks"} {"old_contents":"package com.adaptionsoft.games.uglytrivia;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.fail;\n\npublic class GameCorrectAnswerTest {\n\n @Test\n public void placeMeUnderTest(){\n fail(\"Place Game.correctAnswer under test\");\n }\n}\n","new_contents":"package com.adaptionsoft.games.uglytrivia;\n\nimport org.junit.Ignore;\nimport org.junit.Test;\n\nimport static org.mockito.Mockito.*;\n\npublic class GameCorrectAnswerTest {\n\n @Test\n public void correctAnswerShouldGetACoin() {\n Player player = mock(Player.class);\n Game game = createGameWithSinglePlayer(player);\n\n game.correctAnswer();\n\n verify(player, times(1)).answeredCorrect();\n }\n\n private Game createGameWithSinglePlayer(Player player) {\n Players players = new Players();\n players.add(player);\n return new Game(players, null);\n }\n}","subject":"Test that correct answer gets a coin"} {"old_contents":"package com.janosgyerik.utils.objectstore.api;\n\nimport java.io.IOException;\nimport java.util.Optional;\n\n\/**\n * Store key-value pairs in some backend.\n *\n * @param type of keys\n * @param type of values\n *\/\npublic interface ObjectStore {\n\n void write(K key, V value) throws StoreWriteException;\n\n Optional read(K key) throws StoreReadException;\n}\n","new_contents":"package com.janosgyerik.utils.objectstore.api;\n\nimport java.util.Optional;\n\n\/**\n * Store key-value pairs in some backend.\n *\n * @param type of keys\n * @param type of values\n *\/\npublic interface ObjectStore {\n\n void write(K key, V value);\n\n Optional read(K key);\n}\n","subject":"Remove unnecessary throws and imports"} {"old_contents":"\/*******************************************************************************\n * Copyright (C) 2016 Push Technology Ltd.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *******************************************************************************\/\n\npackage com.pushtechnology.diffusion.transform.messaging;\n\nimport com.pushtechnology.diffusion.client.features.Stream;\n\n\/**\n * A stream of values received as messages.\n *\n * @param the type of values\n * @author Push Technology Limited\n *\/\npublic interface MessageStream extends Stream {\n\n \/**\n * Notified when a message is received.\n *\n * @param path the path to which the message was sent\n * @param message the message\n *\/\n void onMessageReceived(String path, V message);\n}\n","new_contents":"\/*******************************************************************************\n * Copyright (C) 2016 Push Technology Ltd.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *******************************************************************************\/\n\npackage com.pushtechnology.diffusion.transform.messaging;\n\nimport com.pushtechnology.diffusion.client.callbacks.Stream;\n\n\/**\n * A stream of values received as messages.\n *\n * @param the type of values\n * @author Push Technology Limited\n *\/\npublic interface MessageStream extends Stream {\n\n \/**\n * Notified when a message is received.\n *\n * @param path the path to which the message was sent\n * @param message the message\n *\/\n void onMessageReceived(String path, V message);\n}\n","subject":"Use the latest Stream implementation."} {"old_contents":"package cgeo.geocaching;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport cgeo.geocaching.connector.gc.GCConstants;\nimport cgeo.geocaching.maps.mapsforge.MapsforgeMapProvider;\nimport cgeo.geocaching.settings.Settings;\n\nimport android.annotation.TargetApi;\nimport android.test.ActivityInstrumentationTestCase2;\n\n@TargetApi(8)\npublic class SettingsTest extends ActivityInstrumentationTestCase2 {\n\n public SettingsTest() {\n super(MainActivity.class);\n }\n\n \/**\n * access settings.\n * this should work fine without an exception (once there was an exception because of the empty map file string)\n *\/\n public static void testSettingsException() {\n final String mapFile = Settings.getMapFile();\n \/\/ We just want to ensure that it does not throw any exception but we do not know anything about the result\n MapsforgeMapProvider.isValidMapFile(mapFile);\n assertThat(true).isTrue();\n }\n\n public static void testSettings() {\n \/\/ unfortunately, several other tests depend on being a premium member and will fail if run by a basic member\n assertThat(Settings.getGCMemberStatus()).isEqualTo(GCConstants.MEMBER_STATUS_PM);\n }\n\n public static void testDeviceHasNormalLogin() {\n \/\/ if the unit tests were interrupted in a previous run, the device might still have the \"temporary\" login data from the last tests\n assertThat(\"c:geo\".equals(Settings.getUsername())).isFalse();\n }\n}\n","new_contents":"package cgeo.geocaching;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport cgeo.geocaching.connector.gc.GCConstants;\nimport cgeo.geocaching.maps.mapsforge.MapsforgeMapProvider;\nimport cgeo.geocaching.settings.Settings;\n\nimport android.annotation.TargetApi;\nimport android.test.ActivityInstrumentationTestCase2;\n\n@TargetApi(8)\npublic class SettingsTest extends ActivityInstrumentationTestCase2 {\n\n public SettingsTest() {\n super(MainActivity.class);\n }\n\n \/**\n * access settings.\n * this should work fine without an exception (once there was an exception because of the empty map file string)\n *\/\n public static void testSettingsException() {\n \/\/ We just want to ensure that it does not throw any exception but we do not know anything about the result\n MapsforgeMapProvider.isValidMapFile(Settings.getMapFile());\n }\n\n public static void testSettings() {\n \/\/ unfortunately, several other tests depend on being a premium member and will fail if run by a basic member\n assertThat(Settings.getGCMemberStatus()).isEqualTo(GCConstants.MEMBER_STATUS_PM);\n }\n\n public static void testDeviceHasNormalLogin() {\n \/\/ if the unit tests were interrupted in a previous run, the device might still have the \"temporary\" login data from the last tests\n assertThat(\"c:geo\".equals(Settings.getUsername())).isFalse();\n }\n}\n","subject":"Remove useless assertion in test"} {"old_contents":"package semanticanalysis;\n\nimport java.util.*;\n\npublic abstract class ErrorChecker\n{\n private List _errors = new ArrayList();\n\n public List getErrors()\n {\n return _errors;\n }\n\n protected void addError(String error, int line, int column)\n {\n _errors.add(formatError(error, line, column));\n }\n\n private String formatError(String error, int line, int column)\n {\n StringBuilder result = new StringBuilder(error);\n result.append(\" at \");\n result.append(line);\n result.append(\", character \");\n result.append(column);\n return result.toString();\n } \n}\n","new_contents":"package semanticanalysis;\n\nimport java.util.*;\n\npublic abstract class ErrorChecker\n{\n private List _errors = new ArrayList();\n\n public List getErrors()\n {\n return _errors;\n }\n\n protected void addError(String error, int line, int column)\n {\n _errors.add(formatError(error, line, column));\n }\n\n private String formatError(String error, int line, int column)\n {\n StringBuilder result = new StringBuilder(error);\n result.append(\" at line \");\n result.append(line);\n result.append(\", character \");\n result.append(column);\n return result.toString();\n } \n}\n","subject":"Fix small formatting bug in error messages"} {"old_contents":"package de.retest.recheck.configuration;\n\nimport static de.retest.recheck.RecheckProperties.RETEST_FOLDER_NAME;\n\nimport java.nio.file.Path;\nimport java.util.Optional;\n\npublic class ProjectConfigurationUtil {\n\n\tprivate ProjectConfigurationUtil() {}\n\n\tpublic static Optional findProjectConfigurationFolder() {\n\t\treturn ProjectRootFinderUtil.getProjectRoot().map( path -> path.resolve( RETEST_FOLDER_NAME ) );\n\t}\n\n\tpublic static Optional findProjectConfigurationFolder( final Path basePath ) {\n\t\treturn ProjectRootFinderUtil.getProjectRoot( basePath ).map( path -> path.resolve( RETEST_FOLDER_NAME ) );\n\t}\n}\n","new_contents":"package de.retest.recheck.configuration;\n\nimport static de.retest.recheck.RecheckProperties.RETEST_FOLDER_NAME;\n\nimport java.nio.file.Path;\nimport java.util.Optional;\n\npublic class ProjectConfigurationUtil {\n\n\tprivate ProjectConfigurationUtil() {}\n\n\tpublic static Optional findProjectConfigurationFolder() {\n\t\treturn ProjectRootFinderUtil.getProjectRoot().map( path -> path.resolve( RETEST_FOLDER_NAME ) );\n\t}\n\n\tpublic static Optional findProjectConfigurationFolder( final Path basePath ) {\n\t\treturn ProjectRootFinderUtil.getProjectRoot( basePath ).map( path -> path.resolve( RETEST_FOLDER_NAME ) );\n\t}\n\n\tpublic static Optional findSuiteConfigurationFolder( final Path basePath ) {\n\t\treturn Optional.of( basePath.toAbsolutePath() );\n\t}\n}\n","subject":"Add method to return optional path from absolute path of suite ignore"} {"old_contents":"package me.itszooti.geojson;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class GeoPolygon extends GeoGeometry {\n\n\tprivate List exterior;\n\tprivate List> interiors;\n\t\n\tpublic GeoPolygon(List exterior) {\n\t\tthis.exterior = new ArrayList(exterior);\n\t\tthis.interiors = new ArrayList>();\n\t}\n\t\n\tpublic GeoPolygon(List exterior, List> interiors) {\n\t\tthis(exterior);\n\t\tfor (List interior : interiors) {\n\t\t\tthis.interiors.add(new ArrayList(interior));\n\t\t}\n\t}\n\t\n\tpublic int getNumInteriors() {\n\t\treturn interiors.size();\n\t}\n\t\n\tpublic GeoPosition[] getInterior(int index) {\n\t\tList interior = interiors.get(index);\n\t\treturn interior.toArray(new GeoPosition[interior.size()]);\n\t}\n\t\n\tpublic GeoPosition[] getExterior() {\n\t\treturn exterior.toArray(new GeoPosition[exterior.size()]);\n\t}\n\t\n}\n","new_contents":"package me.itszooti.geojson;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class GeoPolygon extends GeoGeometry {\n\n\tprivate List exterior;\n\tprivate List> interiors;\n\t\n\tpublic GeoPolygon(List exterior) {\n\t\tthis.exterior = new ArrayList(exterior);\n\t\tthis.interiors = new ArrayList>();\n\t}\n\t\n\tpublic GeoPolygon(List exterior, List> interiors) {\n\t\tthis(exterior);\n\t\tfor (List interior : interiors) {\n\t\t\tthis.interiors.add(new ArrayList(interior));\n\t\t}\n\t}\n\t\n\tpublic GeoPolygon(GeoPosition[] exterior) {\n\t\tthis(Arrays.asList(exterior));\n\t}\n\t\n\tpublic GeoPolygon(GeoPosition[] exterior, GeoPosition[][] interiors) {\n\t\tthis(Arrays.asList(exterior));\n\t\tfor (int i = 0; i < interiors.length; i++) {\n\t\t\tthis.interiors.add(Arrays.asList(interiors[i]));\n\t\t}\n\t}\n\t\n\tpublic int getNumInteriors() {\n\t\treturn interiors.size();\n\t}\n\t\n\tpublic GeoPosition[] getInterior(int index) {\n\t\tList interior = interiors.get(index);\n\t\treturn interior.toArray(new GeoPosition[interior.size()]);\n\t}\n\t\n\tpublic GeoPosition[] getExterior() {\n\t\treturn exterior.toArray(new GeoPosition[exterior.size()]);\n\t}\n\t\n}\n","subject":"Add array constructor to polygon"} {"old_contents":"package net.somethingdreadful.MAL;\n\nimport android.app.AlertDialog;\nimport android.app.AlertDialog.Builder;\nimport android.app.Dialog;\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.view.ContextThemeWrapper;\n\nimport com.actionbarsherlock.app.SherlockDialogFragment;\n\npublic class LogoutConfirmationDialogFragment extends SherlockDialogFragment {\n public LogoutConfirmationDialogFragment() {}\n\n public interface LogoutConfirmationDialogListener {\n void onLogoutConfirmed();\n }\n\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(getActivity(), R.style.AlertDialog));\n\n builder.setPositiveButton(R.string.dialog_logout_label_confirm, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int whichButton) {\n ((Home) getActivity()).onLogoutConfirmed();\n dismiss();\n }\n })\n .setNegativeButton(R.string.dialog_label_cancel, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int whichButton) {\n dismiss();\n }\n })\n .setTitle(R.string.dialog_logout_title).setMessage(R.string.dialog_logout_message);\n\n return builder.create();\n }\n\n @Override\n public void onDismiss(DialogInterface dialog) {}\n\n @Override\n public void onCancel(DialogInterface dialog) {\n startActivity(new Intent(getActivity(), Home.class));\n this.dismiss();\n }\n\n}\n","new_contents":"package net.somethingdreadful.MAL;\n\nimport android.app.AlertDialog;\nimport android.app.AlertDialog.Builder;\nimport android.app.Dialog;\nimport android.content.DialogInterface;\nimport android.os.Bundle;\nimport android.view.ContextThemeWrapper;\n\nimport com.actionbarsherlock.app.SherlockDialogFragment;\n\npublic class LogoutConfirmationDialogFragment extends SherlockDialogFragment {\n public LogoutConfirmationDialogFragment() {}\n\n public interface LogoutConfirmationDialogListener {\n void onLogoutConfirmed();\n }\n\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(getActivity(), R.style.AlertDialog));\n\n builder.setPositiveButton(R.string.dialog_logout_label_confirm, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int whichButton) {\n ((Home) getActivity()).onLogoutConfirmed();\n dismiss();\n }\n })\n .setNegativeButton(R.string.dialog_label_cancel, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int whichButton) {\n dismiss();\n }\n })\n .setTitle(R.string.dialog_logout_title).setMessage(R.string.dialog_logout_message);\n\n return builder.create();\n }\n\n @Override\n public void onDismiss(DialogInterface dialog) {}\n\n @Override\n public void onCancel(DialogInterface dialog) {\n \/\/ startActivity(new Intent(getActivity(), Home.class)); \/\/Relaunching Home without needing to, causes bad things\n this.dismiss();\n }\n\n}\n","subject":"Fix Logout Dialog Recreating Home"} {"old_contents":"package com.torodb.packaging;\n\nimport com.torodb.packaging.config.model.Config;\nimport com.torodb.packaging.config.model.backend.derby.Derby;\nimport com.torodb.packaging.config.model.generic.LogLevel;\nimport com.torodb.packaging.config.util.ConfigUtils;\nimport java.time.Clock;\nimport java.util.concurrent.TimeUnit;\nimport java.util.concurrent.TimeoutException;\nimport org.junit.Before;\nimport org.junit.Test;\n\n\/**\n *\n * @author gortiz\n *\/\npublic class ToroDBServerTest {\n\n private Config config;\n\n @Before\n public void setUp() {\n config = new Config();\n\n config.getProtocol().getMongo().setReplication(null);\n config.getBackend().setBackendImplementation(new Derby());\n config.getBackend().asDerby().setPassword(\"torodb\");\n config.getGeneric().setLogLevel(LogLevel.TRACE);\n\n ConfigUtils.validateBean(config);\n }\n\n @Test\n public void testCreate() {\n ToroDBServer.create(config, Clock.systemUTC());\n }\n\n @Test\n public void testInitiate() throws TimeoutException {\n ToroDBServer server = ToroDBServer.create(config, Clock.systemUTC());\n\n server.startAsync();\n server.awaitRunning(5, TimeUnit.SECONDS);\n\n server.stopAsync();\n server.awaitTerminated(5, TimeUnit.SECONDS);\n }\n}\n","new_contents":"package com.torodb.packaging;\n\nimport com.torodb.packaging.config.model.Config;\nimport com.torodb.packaging.config.model.backend.derby.Derby;\nimport com.torodb.packaging.config.model.generic.LogLevel;\nimport com.torodb.packaging.config.util.ConfigUtils;\nimport java.time.Clock;\nimport java.util.concurrent.TimeUnit;\nimport java.util.concurrent.TimeoutException;\nimport org.junit.Before;\nimport org.junit.Test;\n\n\/**\n *\n * @author gortiz\n *\/\npublic class ToroDBServerTest {\n\n private Config config;\n\n @Before\n public void setUp() {\n config = new Config();\n\n config.getProtocol().getMongo().setReplication(null);\n config.getBackend().setBackendImplementation(new Derby());\n config.getBackend().asDerby().setPassword(\"torodb\");\n config.getGeneric().setLogLevel(LogLevel.TRACE);\n\n ConfigUtils.validateBean(config);\n }\n\n @Test\n public void testCreate() {\n ToroDBServer.create(config, Clock.systemUTC());\n }\n\n @Test\n public void testInitiate() throws TimeoutException {\n ToroDBServer server = ToroDBServer.create(config, Clock.systemUTC());\n\n server.startAsync();\n server.awaitRunning(10, TimeUnit.SECONDS);\n\n server.stopAsync();\n server.awaitTerminated(10, TimeUnit.SECONDS);\n }\n}\n","subject":"Increase timeout time for \"slow\" systems"} {"old_contents":"package org.stevewinfield.suja.idk.dedicated.commands.defaults;\n\nimport org.apache.log4j.Logger;\nimport org.stevewinfield.suja.idk.Bootloader;\nimport org.stevewinfield.suja.idk.dedicated.commands.IDedicatedServerCommand;\n\npublic class StopCommand implements IDedicatedServerCommand {\n\n @Override\n public void execute(String[] args, Logger logger) {\n logger.info(\"Stopping server...\");\n Bootloader.exitServer(0);\n }\n\n @Override\n public String getName() {\n return \"stop\";\n }\n}\n","new_contents":"package org.stevewinfield.suja.idk.dedicated.commands.defaults;\n\nimport org.apache.log4j.Logger;\nimport org.stevewinfield.suja.idk.Bootloader;\nimport org.stevewinfield.suja.idk.dedicated.commands.IDedicatedServerCommand;\nimport org.stevewinfield.suja.idk.game.rooms.RoomInstance;\nimport org.stevewinfield.suja.idk.network.sessions.Session;\n\npublic class StopCommand implements IDedicatedServerCommand {\n\n @Override\n public void execute(String[] args, Logger logger) {\n logger.info(\"Stopping server...\");\n int i = 0;\n for (final Session session : Bootloader.getSessionManager().getSessions()) {\n session.disconnect();\n i++;\n }\n logger.info(i + \" User(s) was\/were kicked.\");\n i = 0;\n for (final RoomInstance room : Bootloader.getGame().getRoomManager().getLoadedRoomInstances()) {\n room.save();\n i++;\n }\n logger.info(i + \" Room(s) was\/were saved.\");\n Bootloader.exitServer(0);\n }\n\n @Override\n public String getName() {\n return \"stop\";\n }\n}\n","subject":"Save users and rooms before exiting the Server."} {"old_contents":"package fr.unice.polytech.al.trafficlight.utils.enums;\n\n\/**\n * Created by nathael on 27\/10\/16.\n *\/\npublic class TrafficLightId {\n private final String id;\n\n public TrafficLightId(String id) {\n this.id = id;\n }\n\n @Override\n public boolean equals(Object obj) {\n if(obj instanceof String)\n return id.equals((String) obj);\n else if (obj instanceof TrafficLightId) {\n return id.equals(((TrafficLightId) obj).id);\n }\n else return false;\n }\n\n @Override\n public String toString() {\n return \"TL:\"+id;\n }\n}\n","new_contents":"package fr.unice.polytech.al.trafficlight.utils.enums;\n\n\/**\n * Created by nathael on 27\/10\/16.\n *\/\npublic class TrafficLightId {\n private final String id;\n\n public TrafficLightId(String id) {\n this.id = id;\n }\n\n public String getId() {\n return id;\n }\n\n @Override\n public boolean equals(Object obj) {\n if(obj instanceof String)\n return id.equals((String) obj);\n else if (obj instanceof TrafficLightId) {\n return id.equals(((TrafficLightId) obj).id);\n }\n else return false;\n }\n\n @Override\n public String toString() {\n return \"TL:\"+id;\n }\n}\n","subject":"Add a getter to the id"} {"old_contents":"\/*\n * Copyright 2015 The original authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage io.sundr.builder.internal;\n\nimport javax.lang.model.element.TypeElement;\nimport java.util.Collections;\nimport java.util.LinkedHashSet;\nimport java.util.Set;\n\npublic class BuildableRepository {\n\n private final Set buildables = new LinkedHashSet<>();\n\n public void register(TypeElement buildable) {\n buildables.add(buildable);\n }\n\n public Set getBuildables() {\n return Collections.unmodifiableSet(buildables);\n }\n\n public boolean isBuildable(TypeElement buildable) {\n return buildable != null && buildables.contains(buildable.getQualifiedName().toString());\n }\n\n public void clear() {\n buildables.clear();\n }\n}\n","new_contents":"\/*\n * Copyright 2015 The original authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage io.sundr.builder.internal;\n\nimport javax.lang.model.element.TypeElement;\nimport java.util.Collections;\nimport java.util.LinkedHashSet;\nimport java.util.Set;\n\npublic class BuildableRepository {\n\n private final Set buildables = new LinkedHashSet<>();\n\n public void register(TypeElement buildable) {\n buildables.add(buildable);\n }\n\n public Set getBuildables() {\n return Collections.unmodifiableSet(buildables);\n }\n\n public boolean isBuildable(TypeElement buildable) {\n return buildable != null && buildables.contains(buildable);\n }\n\n public void clear() {\n buildables.clear();\n }\n}\n","subject":"Fix isBuildable() in buildable repository."} {"old_contents":"package com.rbmhtechnology.apidocserver.security;\n\nimport org.mitre.openid.connect.client.OIDCAuthenticationFilter;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Lazy;\nimport org.springframework.context.annotation.Profile;\nimport org.springframework.security.authentication.AuthenticationManager;\nimport org.springframework.security.config.annotation.web.builders.HttpSecurity;\nimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;\nimport org.springframework.security.web.AuthenticationEntryPoint;\nimport org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter;\n\n@Configuration\n@Profile(\"openid\")\npublic class OpenIdConnectSecurityConfiguration extends WebSecurityConfigurerAdapter {\n\n private final AuthenticationEntryPoint authenticationEntryPoint;\n private final OIDCAuthenticationFilter authenticationFilter;\n\n public OpenIdConnectSecurityConfiguration(\n AuthenticationEntryPoint authenticationEntryPoint,\n @Lazy OIDCAuthenticationFilter authenticationFilter) {\n this.authenticationEntryPoint = authenticationEntryPoint;\n this.authenticationFilter = authenticationFilter;\n }\n\n @Bean\n @Override\n public AuthenticationManager authenticationManagerBean() throws Exception {\n return super.authenticationManagerBean();\n }\n\n @Override\n public void configure(HttpSecurity http) throws Exception {\n http\n .addFilterBefore(authenticationFilter, AbstractPreAuthenticatedProcessingFilter.class)\n .exceptionHandling().authenticationEntryPoint(authenticationEntryPoint)\n .and().authorizeRequests()\n .antMatchers(\"\/health\").permitAll()\n .anyRequest().authenticated();\n }\n}\n","new_contents":"package com.rbmhtechnology.apidocserver.security;\n\nimport org.mitre.openid.connect.client.OIDCAuthenticationFilter;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Lazy;\nimport org.springframework.context.annotation.Profile;\nimport org.springframework.security.authentication.AuthenticationManager;\nimport org.springframework.security.config.annotation.web.builders.HttpSecurity;\nimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;\nimport org.springframework.security.web.AuthenticationEntryPoint;\nimport org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter;\n\n@Configuration\n@Profile(\"openid\")\npublic class OpenIdConnectSecurityConfiguration extends WebSecurityConfigurerAdapter {\n\n private final AuthenticationEntryPoint authenticationEntryPoint;\n private final OIDCAuthenticationFilter authenticationFilter;\n\n public OpenIdConnectSecurityConfiguration(\n AuthenticationEntryPoint authenticationEntryPoint,\n @Lazy OIDCAuthenticationFilter authenticationFilter) {\n this.authenticationEntryPoint = authenticationEntryPoint;\n this.authenticationFilter = authenticationFilter;\n }\n\n @Bean\n @Override\n public AuthenticationManager authenticationManagerBean() throws Exception {\n return super.authenticationManagerBean();\n }\n\n @Override\n public void configure(HttpSecurity http) throws Exception {\n http\n .addFilterBefore(authenticationFilter, AbstractPreAuthenticatedProcessingFilter.class)\n .exceptionHandling().authenticationEntryPoint(authenticationEntryPoint)\n .and().authorizeRequests()\n .antMatchers(\"\/actuator\/health\").permitAll()\n .anyRequest().authenticated();\n }\n}\n","subject":"Exclude \/actuator\/health from the authenticated resources"} {"old_contents":"package org.jeecqrs.commands.registry;\n\nimport java.util.Iterator;\nimport java.util.logging.Logger;\nimport javax.annotation.PostConstruct;\nimport javax.enterprise.inject.Instance;\nimport javax.inject.Inject;\nimport org.jeecqrs.commands.CommandHandler;\n\n\/**\n *\n *\/\npublic class AutoDiscoverCommandHandlerRegistry extends AbstractCommandHandlerRegistry {\n\n private Logger log = Logger.getLogger(AutoDiscoverCommandHandlerRegistry.class.getName());\n\n @Inject\n private Instance handlerInstances;\n\n @PostConstruct\n public void startup() {\n log.info(\"Scanning command handlers\");\n\tIterator it = handlerInstances.iterator();\n if (!it.hasNext()) {\n log.warning(\"No CommandHandlers found\");\n }\n\twhile (it.hasNext()) {\n CommandHandler h = it.next();\n log.fine(\"Discovered CommandHandler: \"+ h);\n this.register(h.handledCommandType(), h);\n\t}\n }\n \n}\n","new_contents":"package org.jeecqrs.commands.registry;\n\nimport java.util.Iterator;\nimport java.util.logging.Logger;\nimport javax.annotation.PostConstruct;\nimport javax.enterprise.inject.Instance;\nimport javax.inject.Inject;\nimport org.jeecqrs.commands.CommandHandler;\n\n\/**\n *\n *\/\npublic class AutoDiscoverCommandHandlerRegistry extends AbstractCommandHandlerRegistry {\n\n private Logger log = Logger.getLogger(AutoDiscoverCommandHandlerRegistry.class.getName());\n\n @Inject\n private Instance> handlerInstances;\n\n @PostConstruct\n public void startup() {\n log.info(\"Scanning command handlers\");\n\tIterator> it = select(handlerInstances);\n if (!it.hasNext())\n log.warning(\"No CommandHandlers found\");\n\twhile (it.hasNext()) {\n CommandHandler h = it.next();\n log.fine(\"Discovered CommandHandler: \"+ h);\n this.register(h.handledCommandType(), h);\n\t}\n }\n\n protected Iterator> select(Instance> instances) {\n return instances.iterator();\n }\n \n}\n","subject":"Add selection option for instances of CommandHandlers"} {"old_contents":"\/*\n * Copyright 2016 Timothy Brooks\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\/\npackage net.uncontended.precipice.circuit;\n\npublic class CircuitBreakerConfig> {\n\n public final Rejected reason;\n public final Rejected forcedReason;\n public final int failurePercentageThreshold;\n public final long failureThreshold;\n public final long trailingPeriodMillis;\n public final long healthRefreshMillis;\n public final long backOffTimeMillis;\n public final long sampleSizeThreshold;\n\n public CircuitBreakerConfig(Rejected reason, Rejected forcedReason, long failureThreshold, int failurePercentageThreshold,\n long trailingPeriodMillis, long healthRefreshMillis, long backOffTimeMillis,\n long sampleSizeThreshold) {\n this.reason = reason;\n this.forcedReason = forcedReason;\n this.failureThreshold = failureThreshold;\n this.failurePercentageThreshold = failurePercentageThreshold;\n this.trailingPeriodMillis = trailingPeriodMillis;\n this.healthRefreshMillis = healthRefreshMillis;\n this.backOffTimeMillis = backOffTimeMillis;\n this.sampleSizeThreshold = sampleSizeThreshold;\n }\n}\n","new_contents":"\/*\n * Copyright 2016 Timothy Brooks\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\/\npackage net.uncontended.precipice.circuit;\n\npublic class CircuitBreakerConfig> {\n\n public final Rejected reason;\n public final Rejected forcedReason;\n public final int failurePercentageThreshold;\n public final long failureThreshold;\n \/\/ TODO: Change these all to nanos to avoid computing millis time\n public final long trailingPeriodMillis;\n public final long healthRefreshMillis;\n public final long backOffTimeMillis;\n public final long sampleSizeThreshold;\n\n public CircuitBreakerConfig(Rejected reason, Rejected forcedReason, long failureThreshold, int failurePercentageThreshold,\n long trailingPeriodMillis, long healthRefreshMillis, long backOffTimeMillis,\n long sampleSizeThreshold) {\n this.reason = reason;\n this.forcedReason = forcedReason;\n this.failureThreshold = failureThreshold;\n this.failurePercentageThreshold = failurePercentageThreshold;\n this.trailingPeriodMillis = trailingPeriodMillis;\n this.healthRefreshMillis = healthRefreshMillis;\n this.backOffTimeMillis = backOffTimeMillis;\n this.sampleSizeThreshold = sampleSizeThreshold;\n }\n}\n","subject":"Add comment about work to be completed"} {"old_contents":"package uk.ac.ebi.quickgo.indexer;\n\nimport java.text.DateFormat;\nimport java.text.SimpleDateFormat;\nimport java.util.Calendar;\n\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.support.ClassPathXmlApplicationContext;\n\n\n\/**\n * Process to index all the information in Solr\n *\n * @author cbonill\n *\n *\/\npublic class QuickGOIndexerProcess {\n\n\n\t\tstatic ApplicationContext appContext;\n\t\tstatic QuickGOIndexer quickGOIndexer;\n\n\t\t\/**\n\t\t * We can use this method for indexing the data in Solr for the moment\n\t\t *\n\t\t * @param args\n\t\t *\/\n\t\tpublic static void main(String[] args) {\n\n\t\t\tappContext = new ClassPathXmlApplicationContext(\"common-beans.xml\",\t\"indexing-beans.xml\", \"query-beans.xml\");\n\t\t\tquickGOIndexer = (QuickGOIndexer) appContext.getBean(\"quickGOIndexer\");\n\t\t\tString start = DateFormat.getInstance().format(Calendar.getInstance().getTime());\n\t\t\tSystem.out.println(\"================================================================\");\n\t\t\tSystem.out.println(\"STARTED: \" + start);\n\t\t\tSystem.out.println(\"================================================================\");\n\t\t\tquickGOIndexer.index();\n\t\t\tSystem.out.println(\"================================================================\");\n\t\t\tSystem.out.println(\"DONE: \" + DateFormat.getInstance().format(Calendar.getInstance().getTime()));\n\t\t\tSystem.out.println(\"================================================================\");\n\t\t}\n}\n","new_contents":"package uk.ac.ebi.quickgo.indexer;\n\nimport java.text.DateFormat;\nimport java.text.SimpleDateFormat;\nimport java.util.Calendar;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.support.ClassPathXmlApplicationContext;\n\n\n\/**\n * Process to index all the information in Solr\n *\n * @author cbonill\n *\/\npublic class QuickGOIndexerProcess {\n\n\n\tstatic ApplicationContext appContext;\n\tstatic QuickGOIndexer quickGOIndexer;\n\n\tfinal static Logger logger = LoggerFactory.getLogger(QuickGOIndexerProcess.class);\n\n\t\/**\n\t * We can use this method for indexing the data in Solr for the moment\n\t *\n\t * @param args\n\t *\/\n\tpublic static void main(String[] args) {\n\n\t\tappContext = new ClassPathXmlApplicationContext(\"common-beans.xml\", \"indexing-beans.xml\", \"query-beans.xml\");\n\t\tquickGOIndexer = (QuickGOIndexer) appContext.getBean(\"quickGOIndexer\");\n\t\tString start = DateFormat.getInstance().format(Calendar.getInstance().getTime());\n\t\tlogger.info(\"================================================================\");\n\t\tlogger.info(\"STARTED: \" + start);\n\t\tlogger.info(\"================================================================\");\n\t\tquickGOIndexer.index();\n\t\tlogger.info(\"================================================================\");\n\t\tlogger.info(\"DONE: \" + DateFormat.getInstance().format(Calendar.getInstance().getTime()));\n\t\tlogger.info(\"================================================================\");\n\t}\n}\n","subject":"Move from using Log4j to Simple Logging Facade For Java (SLF4J)"} {"old_contents":"package org.realityforge.replicant.client.gwt;\n\nimport dagger.Module;\nimport dagger.Provides;\nimport javax.annotation.Nonnull;\nimport javax.inject.Singleton;\nimport org.realityforge.replicant.client.EntitySubscriptionManager;\nimport org.realityforge.replicant.client.EntitySubscriptionManagerImpl;\nimport org.realityforge.replicant.client.transport.CacheService;\n\n\/**\n * A simple Dagger module that defines the repository and change broker services.\n *\/\n@Module\npublic class ReplicantDaggerModule\n{\n @Nonnull\n @Provides\n @Singleton\n public static EntitySubscriptionManager provideEntitySubscriptionManager( @Nonnull final EntitySubscriptionManagerImpl service )\n {\n return service;\n }\n\n @Nonnull\n @Provides\n @Singleton\n public static CacheService provideCacheService( @Nonnull final LocalCacheService service )\n {\n return service;\n }\n}\n","new_contents":"package org.realityforge.replicant.client.gwt;\n\nimport dagger.Module;\nimport dagger.Provides;\nimport javax.annotation.Nonnull;\nimport javax.inject.Singleton;\nimport org.realityforge.replicant.client.EntitySubscriptionManager;\nimport org.realityforge.replicant.client.EntitySubscriptionManagerImpl;\nimport org.realityforge.replicant.client.transport.CacheService;\n\n\/**\n * A simple Dagger module for replicant.\n *\/\n@Module\npublic class ReplicantDaggerModule\n{\n @Nonnull\n @Provides\n @Singleton\n public static EntitySubscriptionManager provideEntitySubscriptionManager( @Nonnull final EntitySubscriptionManagerImpl service )\n {\n return service;\n }\n\n @Nonnull\n @Provides\n @Singleton\n public static CacheService provideCacheService( @Nonnull final LocalCacheService service )\n {\n return service;\n }\n}\n","subject":"Update docs to be less incorrect"} {"old_contents":"\/* $This file is distributed under the terms of the license in \/doc\/license.txt$ *\/\n\npackage edu.cornell.mannlib.vitro.webapp.web.templatemodels.searchresult;\n\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\n\nimport edu.cornell.mannlib.vitro.webapp.beans.Individual;\nimport edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;\n\npublic class IndividualSearchResult extends BaseIndividualSearchResult {\n\n private static final Log log = LogFactory.getLog(IndividualSearchResult.class);\n\n private static final String CORE = \"http:\/\/vivoweb.org\/ontology\/core#\";\n \n public IndividualSearchResult(Individual individual, VitroRequest vreq) {\n \tsuper(individual, vreq);\n \tlog.info(\"Called Individual Search Result\");\n }\n \n \/* Access methods for templates *\/\n \n public String getPreferredTitle() {\n \tlog.info(\"Called get Title\");\n return individual.getDataValue(CORE + \"preferredTitle\");\n }\n \n public String getEmail() {\n \tlog.info(\"Called get Email\");\n \treturn individual.getDataValue(CORE + \"email\");\n }\n\n}","new_contents":"\/* $This file is distributed under the terms of the license in \/doc\/license.txt$ *\/\n\npackage edu.cornell.mannlib.vitro.webapp.web.templatemodels.searchresult;\n\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\n\nimport edu.cornell.mannlib.vitro.webapp.beans.Individual;\nimport edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;\n\npublic class IndividualSearchResult extends BaseIndividualSearchResult {\n\n private static final Log log = LogFactory.getLog(IndividualSearchResult.class);\n\n private static final String CORE = \"http:\/\/vivoweb.org\/ontology\/core#\";\n \n public IndividualSearchResult(Individual individual, VitroRequest vreq) {\n \tsuper(individual, vreq);\n \tlog.debug(\"Called Individual Search Result\");\n }\n \n \/* Access methods for templates *\/\n \n public String getPreferredTitle() {\n \tlog.debug(\"Called get Title\");\n return individual.getDataValue(CORE + \"preferredTitle\");\n }\n \n public String getEmail() {\n \tlog.debug(\"Called get Email\");\n \treturn individual.getDataValue(CORE + \"email\");\n }\n\n}","subject":"Remove superfluous noise from the log."} {"old_contents":"\/**\n * An implementation of the NASDAQ MoldUDP64 1.0 protocol.\n *\n *

      The implementation is based on the Java NIO API.<\/p>\n *\n *

      The underlying socket channels can be either blocking or non-blocking.\n * In both cases, data transmission always blocks.<\/p>\n *\/\npackage org.jvirtanen.nassau.moldudp64;\n","new_contents":"\/**\n * An implementation of the NASDAQ MoldUDP64 1.00 protocol.\n *\n *

      The implementation is based on the Java NIO API.<\/p>\n *\n *

      The underlying socket channels can be either blocking or non-blocking.\n * In both cases, data transmission always blocks.<\/p>\n *\/\npackage org.jvirtanen.nassau.moldudp64;\n","subject":"Fix NASDAQ MoldUDP64 version number"} {"old_contents":"\/**\n*\tNotificationService.java\n*\n*\t@author Johan\n*\/\n\npackage se.chalmers.watchme.notifications;\n\nimport java.util.Calendar;\n\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.Binder;\nimport android.os.IBinder;\n\npublic class NotificationService extends Service {\n\t\n\tprivate final IBinder binder = new ServiceBinder();\n\n\tpublic class ServiceBinder extends Binder {\n\t\tNotificationService getService() {\n\t\t\treturn NotificationService.this;\n\t\t}\n\t}\n\n\t@Override\n\tpublic IBinder onBind(Intent arg0) {\n\t\treturn this.binder;\n\t}\n\t\n\tpublic int startCommand(Intent intent, int flags, int startID) {\n\n\t\t\/\/ This service is sticky - it runs until it's stopped.\n\t\treturn START_STICKY;\n\t}\n\t\n\tpublic void setAlarm(Calendar c) {\n\t\t\/\/ Start a new task for the alarm on another thread (separated from the UI thread)\n\t\tnew AlarmTask(this, c).run();\n\t}\n}\n","new_contents":"\/**\n*\tNotificationService.java\n*\n*\t@author Johan\n*\/\n\npackage se.chalmers.watchme.notifications;\n\nimport java.util.Calendar;\n\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.Binder;\nimport android.os.IBinder;\nimport android.util.Log;\n\npublic class NotificationService extends Service {\n\t\n\tprivate final IBinder binder = new ServiceBinder();\n\n\tpublic class ServiceBinder extends Binder {\n\t\tNotificationService getService() {\n\t\t\treturn NotificationService.this;\n\t\t}\n\t}\n\n\t@Override\n\tpublic IBinder onBind(Intent arg0) {\n\t\treturn this.binder;\n\t}\n\t\n\t@Override\n\tpublic int onStartCommand(Intent intent, int flags, int startID) {\n\t\tLog.i(\"Custom\", \"Received start id \" + startID + \": \" + intent);\n\t\t\t\t\n\t\t\/\/ This service is sticky - it runs until it's stopped.\n\t\treturn START_STICKY;\n\t}\n\t\n\tpublic void setAlarm(Calendar c) {\n\t\tLog.i(\"Custom\", \"Set alarm\");\n\t\t\/\/ Start a new task for the alarm on another thread (separated from the UI thread)\n\t\tnew AlarmTask(this, c).run();\n\t}\n}\n","subject":"Fix incorrect name of start command callback"} {"old_contents":"package com.jedrzejewski.slisp.interpreter.primitives;\n\nimport com.jedrzejewski.slisp.lispobjects.LispObject;\nimport com.jedrzejewski.slisp.lispobjects.Num;\nimport java.util.List;\n\npublic abstract class NumPairTester extends Primitive {\n\n public boolean testSubsequentPairs(List args, DoublePairPredicate predicate) {\n double prevValue = ((Num) args.get(0)).getValue();\n for (LispObject arg : args.subList(1, args.size())) {\n double curValue = ((Num) arg).getValue();\n if (!predicate.test(prevValue, curValue)) {\n return false;\n } else {\n prevValue = curValue;\n }\n }\n return true;\n }\n\n public interface DoublePairPredicate {\n boolean test(double val1, double val2);\n }\n}\n","new_contents":"package com.jedrzejewski.slisp.interpreter.primitives;\n\nimport com.jedrzejewski.slisp.interpreter.exceptions.InterpreterException;\nimport com.jedrzejewski.slisp.interpreter.exceptions.WrongNumberOfArgsException;\nimport com.jedrzejewski.slisp.lispobjects.LispObject;\nimport com.jedrzejewski.slisp.lispobjects.Num;\nimport java.util.List;\n\npublic abstract class NumPairTester extends Primitive {\n\n public boolean testSubsequentPairs(List args,\n DoublePairPredicate predicate)\n throws InterpreterException {\n validate(args);\n\n double prevValue = ((Num) args.get(0)).getValue();\n for (LispObject arg : args.subList(1, args.size())) {\n double curValue = ((Num) arg).getValue();\n if (!predicate.test(prevValue, curValue)) {\n return false;\n } else {\n prevValue = curValue;\n }\n }\n return true;\n }\n\n public void validate(List args) throws InterpreterException {\n if (args.size() <= 1) {\n throw WrongNumberOfArgsException.atLeast(2).is(args.size());\n }\n \/\/ TODO: check types.\n }\n\n public interface DoublePairPredicate {\n boolean test(double val1, double val2);\n }\n}\n","subject":"Check no of args in comp primitives"} {"old_contents":"\/**\n * Components for accessing the Web API of a Wikibase website, such as wikidata.org. \n * \n * @author Markus Kroetzsch\n *\n *\/\npackage org.wikidata.wdtk.wikibaseapi;","new_contents":"\/**\n * Components for accessing the Web API of a Wikibase website, such as wikidata.org. \n * \n * @author Markus Kroetzsch\n *\n *\/\npackage org.wikidata.wdtk.wikibaseapi;\n\n\/*\n * #%L\n * Wikidata Toolkit Wikibase API\n * %%\n * Copyright (C) 2014 Wikidata Toolkit Developers\n * %%\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * #L%\n *\/\n","subject":"Add license information to file."} {"old_contents":"package com.google.appengine.tools.cloudstorage.oauth;\n\nimport com.google.appengine.api.appidentity.AppIdentityService;\nimport com.google.appengine.api.appidentity.AppIdentityService.GetAccessTokenResult;\nimport com.google.appengine.api.appidentity.AppIdentityServiceFactory;\nimport com.google.appengine.api.utils.SystemProperty;\n\nimport java.util.List;\n\n\/**\n * Provider that uses the AppIdentityService for generating access tokens.\n *\/\nfinal class AppIdentityAccessTokenProvider implements AccessTokenProvider {\n private final AppIdentityService appIdentityService;\n\n public AppIdentityAccessTokenProvider() {\n if (SystemProperty.environment.value() == SystemProperty.Environment.Value.Development) {\n throw new IllegalStateException(\n \"The access token from AppIdentity won't work in the development environment.\");\n }\n this.appIdentityService = AppIdentityServiceFactory.getAppIdentityService();\n }\n\n @Override\n public GetAccessTokenResult getNewAccessToken(List scopes) {\n return appIdentityService.getAccessToken(scopes);\n }\n}\n","new_contents":"package com.google.appengine.tools.cloudstorage.oauth;\n\nimport com.google.appengine.api.appidentity.AppIdentityService;\nimport com.google.appengine.api.appidentity.AppIdentityService.GetAccessTokenResult;\nimport com.google.appengine.api.appidentity.AppIdentityServiceFactory;\nimport com.google.appengine.api.utils.SystemProperty;\n\nimport java.util.List;\n\n\/**\n * Provider that uses the AppIdentityService for generating access tokens.\n *\/\nfinal class AppIdentityAccessTokenProvider implements AccessTokenProvider {\n private final AppIdentityService appIdentityService;\n\n public AppIdentityAccessTokenProvider() {\n this.appIdentityService = AppIdentityServiceFactory.getAppIdentityService();\n }\n\n @Override\n public GetAccessTokenResult getNewAccessToken(List scopes) {\n if (SystemProperty.environment.value() == SystemProperty.Environment.Value.Development) {\n throw new IllegalStateException(\n \"The access token from AppIdentity won't work in the development environment.\");\n }\n return appIdentityService.getAccessToken(scopes);\n }\n}\n","subject":"Move check for development environment into the getNewAccessToken method."} {"old_contents":"package devopsdistilled.operp.server;\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.net.URL;\nimport java.util.Properties;\n\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.annotation.AnnotationConfigApplicationContext;\n\nimport devopsdistilled.operp.server.context.AppContext;\n\npublic class ServerApp {\n\n\tpublic static void main(String[] args) {\n\t\tApplicationContext context = new AnnotationConfigApplicationContext(\n\t\t\t\tAppContext.class);\n\n\t\tProperties hibernateProperties = new Properties();\n\t\tURL hibernatePropertiesFileUrl = ServerApp.class.getClassLoader()\n\t\t\t\t.getResource(\"server\/hibernate.properties\");\n\t\tFile hibernatePropertiesFile = new File(\n\t\t\t\thibernatePropertiesFileUrl.getFile());\n\t\ttry {\n\t\t\tInputStream in = new FileInputStream(hibernatePropertiesFile);\n\t\t\thibernateProperties.load(in);\n\t\t\tString hbm2dllKey = \"hibernate.hbm2ddl.auto\";\n\t\t\tString hbm2ddlValue = hibernateProperties.getProperty(hbm2dllKey);\n\n\t\t\tif (hbm2ddlValue.equalsIgnoreCase(\"create\"))\n\t\t\t\thibernateProperties.setProperty(hbm2dllKey, \"update\");\n\n\t\t\tin.close();\n\t\t\tOutputStream out = new FileOutputStream(hibernatePropertiesFile);\n\t\t\thibernateProperties.store(out, null);\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"hibernate.properties file not found!\");\n\t\t}\n\n\t\tSystem.out.println(context);\n\t}\n}\n","new_contents":"package devopsdistilled.operp.server;\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.net.URL;\nimport java.util.Properties;\n\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.annotation.AnnotationConfigApplicationContext;\n\nimport devopsdistilled.operp.server.context.AppContext;\n\npublic class ServerApp {\n\n\tpublic static void main(String[] args) {\n\t\tApplicationContext context = new AnnotationConfigApplicationContext(\n\t\t\t\tAppContext.class);\n\n\t\tProperties hibernateProperties = new Properties();\n\t\tURL hibernatePropertiesFileUrl = ServerApp.class.getClassLoader()\n\t\t\t\t.getResource(\"server\/hibernate.properties\");\n\t\tFile hibernatePropertiesFile = new File(\n\t\t\t\thibernatePropertiesFileUrl.getFile());\n\t\ttry {\n\t\t\tInputStream in = new FileInputStream(hibernatePropertiesFile);\n\t\t\thibernateProperties.load(in);\n\t\t\tString hbm2dllKey = \"hibernate.hbm2ddl.auto\";\n\t\t\tString hbm2ddlValue = hibernateProperties.getProperty(hbm2dllKey);\n\n\t\t\tif (hbm2ddlValue.equalsIgnoreCase(\"create\"))\n\t\t\t\thibernateProperties.setProperty(hbm2dllKey, \"update\");\n\n\t\t\tin.close();\n\t\t\tOutputStream out = new FileOutputStream(hibernatePropertiesFile);\n\t\t\thibernateProperties.store(out, null);\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"hibernate.properties file not found!\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tSystem.out.println(context);\n\t}\n}\n","subject":"Print stack trace upon error"} {"old_contents":"\/*\n * Copyright 2016 SEARCH-The National Consortium for Justice Information and Statistics\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.search.nibrs.stagingdata.service;\n\nimport org.search.nibrs.stagingdata.model.segment.ArrestReportSegment;\nimport org.search.nibrs.stagingdata.repository.segment.ArrestReportSegmentRepository;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\n\n\/**\n * Service to process Group B Arrest Report. \n *\n *\/\n@Service\npublic class ArrestReportService {\n\t@Autowired\n\tArrestReportSegmentRepository arrestReportSegmentRepository;\n\t\n\tpublic ArrestReportSegment saveArrestReportSegment(ArrestReportSegment arrestReportSegment){\n\t\treturn arrestReportSegmentRepository.save(arrestReportSegment);\n\t}\n\t\n\tpublic ArrestReportSegment findArrestReportSegment(Integer id){\n\t\treturn arrestReportSegmentRepository.findOne(id);\n\t}\n}\n","new_contents":"\/*\n * Copyright 2016 SEARCH-The National Consortium for Justice Information and Statistics\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.search.nibrs.stagingdata.service;\n\nimport javax.transaction.Transactional;\n\nimport org.search.nibrs.stagingdata.model.segment.ArrestReportSegment;\nimport org.search.nibrs.stagingdata.repository.segment.ArrestReportSegmentRepository;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\n\n\/**\n * Service to process Group B Arrest Report. \n *\n *\/\n@Service\npublic class ArrestReportService {\n\t@Autowired\n\tArrestReportSegmentRepository arrestReportSegmentRepository;\n\t\n\t@Transactional\n\tpublic ArrestReportSegment saveArrestReportSegment(ArrestReportSegment arrestReportSegment){\n\t\treturn arrestReportSegmentRepository.save(arrestReportSegment);\n\t}\n\t\n\tpublic ArrestReportSegment findArrestReportSegment(Integer id){\n\t\treturn arrestReportSegmentRepository.findOne(id);\n\t}\n}\n","subject":"Add @Transactional to the save method."} {"old_contents":"package tk.martijn_heil.kingdomessentials.playerclass.hooks;\n\n\nimport me.clip.placeholderapi.PlaceholderAPI;\nimport me.clip.placeholderapi.external.EZPlaceholderHook;\nimport org.bukkit.Bukkit;\nimport org.bukkit.entity.Player;\nimport org.bukkit.plugin.Plugin;\nimport tk.martijn_heil.kingdomessentials.playerclass.ModPlayerClass;\nimport tk.martijn_heil.kingdomessentials.playerclass.model.COnlinePlayer;\n\npublic class PlaceHolderApiHook\n{\n private boolean usePlaceHolderApi;\n\n\n public PlaceHolderApiHook()\n {\n if (Bukkit.getPluginManager().isPluginEnabled(\"PlaceHolderAPI\"))\n {\n ModPlayerClass.getInstance().getNinLogger().info(\"PlaceHolderAPI detected! Hooking in.\");\n this.usePlaceHolderApi = true;\n new Hook(ModPlayerClass.getInstance());\n }\n }\n\n\n public String parse(Player p, String s)\n {\n return (this.usePlaceHolderApi) ? PlaceholderAPI.setPlaceholders(p, s) : s;\n }\n\n\n private class Hook extends EZPlaceholderHook\n {\n public Hook(Plugin plugin)\n {\n super(plugin, \"kingdomess\");\n }\n\n\n @Override\n public String onPlaceholderRequest(Player player, String s)\n {\n switch (s)\n {\n case (\"class_display_name\"):\n return new COnlinePlayer(player).getPlayerClass().getDisplayName();\n\n case(\"class_id\"):\n return new COnlinePlayer(player).getPlayerClass().getId();\n }\n\n return null;\n }\n }\n}\n","new_contents":"package tk.martijn_heil.kingdomessentials.playerclass.hooks;\n\n\nimport me.clip.placeholderapi.PlaceholderAPI;\nimport me.clip.placeholderapi.external.EZPlaceholderHook;\nimport org.bukkit.Bukkit;\nimport org.bukkit.entity.Player;\nimport org.bukkit.plugin.Plugin;\nimport tk.martijn_heil.kingdomessentials.playerclass.ModPlayerClass;\nimport tk.martijn_heil.kingdomessentials.playerclass.model.COnlinePlayer;\n\npublic class PlaceHolderApiHook\n{\n private boolean usePlaceHolderApi;\n\n\n public PlaceHolderApiHook()\n {\n if (Bukkit.getPluginManager().isPluginEnabled(\"PlaceholderAPI\"))\n {\n ModPlayerClass.getInstance().getNinLogger().info(\"PlaceholderAPI detected! Hooking in.\");\n this.usePlaceHolderApi = true;\n new Hook(ModPlayerClass.getInstance());\n }\n }\n\n\n public String parse(Player p, String s)\n {\n return (this.usePlaceHolderApi) ? PlaceholderAPI.setPlaceholders(p, s) : s;\n }\n\n\n private class Hook extends EZPlaceholderHook\n {\n public Hook(Plugin plugin)\n {\n super(plugin, \"kingdomess\");\n }\n\n\n @Override\n public String onPlaceholderRequest(Player player, String s)\n {\n switch (s)\n {\n case (\"class_display_name\"):\n return new COnlinePlayer(player).getPlayerClass().getDisplayName();\n\n case(\"class_id\"):\n return new COnlinePlayer(player).getPlayerClass().getId();\n }\n\n return null;\n }\n }\n}\n","subject":"Fix PlaceholderAPI not being detected due to incorrect casing"} {"old_contents":"\/*\n * Copyright Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.google.samples.quickstart.analytics;\n\nimport android.app.Application;\n\nimport com.google.android.gms.analytics.GoogleAnalytics;\nimport com.google.android.gms.analytics.Logger;\nimport com.google.android.gms.analytics.Tracker;\n\n\/**\n * This is a subclass of {@link Application} used to provide shared objects for this app, such as\n * the {@link Tracker}.\n *\/\npublic class AnalyticsApplication extends Application {\n private Tracker mTracker;\n\n \/**\n * Gets the default {@link Tracker} for this {@link Application}.\n * @return tracker\n *\/\n synchronized public Tracker getDefaultTracker() {\n if (mTracker == null) {\n GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);\n analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);\n mTracker = analytics.newTracker(R.xml.tracker);\n }\n return mTracker;\n }\n}\n","new_contents":"\/*\n * Copyright Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.google.samples.quickstart.analytics;\n\nimport android.app.Application;\n\nimport com.google.android.gms.analytics.GoogleAnalytics;\nimport com.google.android.gms.analytics.Logger;\nimport com.google.android.gms.analytics.Tracker;\n\n\/**\n * This is a subclass of {@link Application} used to provide shared objects for this app, such as\n * the {@link Tracker}.\n *\/\npublic class AnalyticsApplication extends Application {\n private Tracker mTracker;\n\n \/**\n * Gets the default {@link Tracker} for this {@link Application}.\n * @return tracker\n *\/\n synchronized public Tracker getDefaultTracker() {\n if (mTracker == null) {\n GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);\n analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);\n mTracker = analytics.newTracker(R.xml.global_tracker);\n }\n return mTracker;\n }\n}\n","subject":"Move to generated tracker name"} {"old_contents":"\/*\n * Copyright © 2012 Sebastian Hoß \n * This work is free. You can redistribute it and\/or modify it under the\n * terms of the Do What The Fuck You Want To Public License, Version 2,\n * as published by Sam Hocevar. See http:\/\/www.wtfpl.net\/ for more details.\n *\/\npackage com.github.sebhoss.contract.verifier;\n\nimport com.github.sebhoss.contract.annotation.Clause;\nimport com.github.sebhoss.contract.annotation.SpEL;\n\nimport org.springframework.expression.EvaluationContext;\nimport org.springframework.expression.ExpressionParser;\nimport org.springframework.expression.spel.standard.SpelExpressionParser;\nimport org.springframework.expression.spel.support.StandardEvaluationContext;\n\n\/**\n * SpEL-based implementation of the {@link ContractContextFactory}.\n *\/\n@SpEL\npublic class SpELBasedContractContextFactory implements ContractContextFactory {\n\n @Override\n public ContractContext createContext(final Object instance, final Object[] arguments, final String[] parameterNames) {\n final ExpressionParser parser = new SpelExpressionParser();\n final EvaluationContext context = new StandardEvaluationContext();\n\n for (int index = 0; index < arguments.length; index++) {\n context.setVariable(parameterNames[index], arguments[index]);\n }\n context.setVariable(Clause.THIS, instance);\n\n return new SpELContractContext(parser, context);\n }\n\n}\n","new_contents":"\/*\n * Copyright © 2012 Sebastian Hoß \n * This work is free. You can redistribute it and\/or modify it under the\n * terms of the Do What The Fuck You Want To Public License, Version 2,\n * as published by Sam Hocevar. See http:\/\/www.wtfpl.net\/ for more details.\n *\/\npackage com.github.sebhoss.contract.verifier;\n\nimport com.github.sebhoss.contract.annotation.SpEL;\n\nimport org.springframework.expression.EvaluationContext;\nimport org.springframework.expression.ExpressionParser;\nimport org.springframework.expression.spel.standard.SpelExpressionParser;\nimport org.springframework.expression.spel.support.StandardEvaluationContext;\n\n\/**\n * SpEL-based implementation of the {@link ContractContextFactory}.\n *\/\n@SpEL\npublic class SpELBasedContractContextFactory implements ContractContextFactory {\n\n @Override\n public ContractContext createContext(final Object instance, final Object[] arguments, final String[] parameterNames) {\n final ExpressionParser parser = new SpelExpressionParser();\n final EvaluationContext context = new StandardEvaluationContext(instance);\n\n for (int index = 0; index < arguments.length; index++) {\n context.setVariable(parameterNames[index], arguments[index]);\n }\n\n return new SpELContractContext(parser, context);\n }\n\n}\n","subject":"Set current instance as root object"} {"old_contents":"package detective.common.httpclient;\n\nimport java.util.concurrent.TimeUnit;\n\nimport org.apache.http.conn.HttpClientConnectionManager;\n\npublic class IdleConnectionMonitorThread extends Thread {\n\n private final HttpClientConnectionManager connMgr;\n private volatile boolean shutdown;\n\n public IdleConnectionMonitorThread(HttpClientConnectionManager connMgr) {\n super();\n this.connMgr = connMgr;\n }\n\n @Override\n public void run() {\n try {\n while (!shutdown) {\n synchronized (this) {\n wait(5000);\n \/\/ Close expired connections\n connMgr.closeExpiredConnections();\n \/\/ Optionally, close connections\n \/\/ that have been idle longer than 30 sec\n connMgr.closeIdleConnections(30, TimeUnit.SECONDS);\n }\n }\n } catch (InterruptedException ex) {\n \/\/ terminate\n }\n }\n\n public void shutdown() {\n shutdown = true;\n synchronized (this) {\n notifyAll();\n }\n }\n\n}","new_contents":"package detective.common.httpclient;\n\nimport java.util.concurrent.TimeUnit;\n\nimport org.apache.http.conn.HttpClientConnectionManager;\n\npublic class IdleConnectionMonitorThread extends Thread {\n\n private final HttpClientConnectionManager connMgr;\n private volatile boolean shutdown;\n\n public IdleConnectionMonitorThread(HttpClientConnectionManager connMgr) {\n super();\n this.connMgr = connMgr;\n \n this.setDaemon(true);\n }\n\n @Override\n public void run() {\n try {\n while (!shutdown) {\n synchronized (this) {\n wait(5000);\n \/\/ Close expired connections\n connMgr.closeExpiredConnections();\n \/\/ Optionally, close connections\n \/\/ that have been idle longer than 30 sec\n connMgr.closeIdleConnections(30, TimeUnit.SECONDS);\n }\n }\n } catch (InterruptedException ex) {\n \/\/ terminate\n }\n }\n\n public void shutdown() {\n shutdown = true;\n synchronized (this) {\n notifyAll();\n }\n }\n\n}","subject":"Change the background thread to daemon thread so that a script closes all other threads closes as well"} {"old_contents":"package org.pdxfinder.repositories;\n\nimport org.pdxfinder.dao.OntologyTerm;\nimport org.springframework.data.neo4j.annotation.Query;\nimport org.springframework.data.repository.PagingAndSortingRepository;\nimport org.springframework.data.repository.query.Param;\nimport org.springframework.stereotype.Repository;\n\nimport java.util.Collection;\n\n\/**\n * Created by csaba on 07\/06\/2017.\n *\/\n@Repository\npublic interface OntologyTermRepository extends PagingAndSortingRepository\n{\n\n OntologyTerm findById();\n\n @Query(\"MATCH (o:OntologyTerm) WHERE toLower(o.label) = toLower({label}) return o\")\n OntologyTerm findByLabel(@Param(\"label\") String label);\n\n OntologyTerm findByUrl(String url);\n\n \/\/AUTO-SUGGEST: Returns all OntologyTerms with mapped samples and all their ancestors\n @Query(\"MATCH (st:OntologyTerm)<-[*]-(ot:OntologyTerm) \" +\n \"MATCH (ot)-[m:MAPPED_TO]-(s:Sample) \" +\n \"RETURN ot,st\")\n Collection findAllWithMappings();\n\n\n\n\n}","new_contents":"package org.pdxfinder.repositories;\n\nimport org.pdxfinder.dao.OntologyTerm;\nimport org.springframework.data.neo4j.annotation.Query;\nimport org.springframework.data.repository.PagingAndSortingRepository;\nimport org.springframework.data.repository.query.Param;\nimport org.springframework.stereotype.Repository;\n\nimport java.util.Collection;\nimport java.util.Set;\n\n\/**\n * Created by csaba on 07\/06\/2017.\n *\/\n@Repository\npublic interface OntologyTermRepository extends PagingAndSortingRepository\n{\n\n OntologyTerm findById();\n\n @Query(\"MATCH (o:OntologyTerm) WHERE toLower(o.label) = toLower({label}) return o\")\n OntologyTerm findByLabel(@Param(\"label\") String label);\n\n OntologyTerm findByUrl(String url);\n\n \/\/AUTO-SUGGEST: Returns all OntologyTerms with mapped samples and all their ancestors\n @Query(\"MATCH (st:OntologyTerm)<-[*]-(ot:OntologyTerm) \" +\n \"MATCH (ot)-[m:MAPPED_TO]-(s:Sample) \" +\n \"RETURN ot,st\")\n Collection findAllWithMappings();\n\n @Query(\"MATCH (ot:OntologyTerm) RETURN ot\")\n Collection findAll();\n\n @Query(\"MATCH (st:OntologyTerm)<-[*]-(term:OntologyTerm) \" +\n \"WHERE st.label = {label} \" +\n \"RETURN sum(term.indirectMappedSamplesNumber)\")\n int getIndirectMappingNumber(@Param(\"label\") String label);\n\n @Query(\"MATCH (st:OntologyTerm)<-[*]-(term:OntologyTerm) \" +\n \"WHERE st.label = {label} \" +\n \"RETURN term, st\")\n Set getDistinctSubTreeNodes(@Param(\"label\") String label);\n\n\n}","subject":"Add findAll() and direct\/indirect mapping number getter"} {"old_contents":"\/\/ Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\npackage com.yahoo.config.provision.zone;\n\nimport com.yahoo.config.provision.CloudName;\nimport com.yahoo.config.provision.Environment;\nimport com.yahoo.config.provision.RegionName;\nimport com.yahoo.config.provision.SystemName;\n\n\/**\n * @author hakonhall\n *\/\npublic interface ZoneApi {\n\n SystemName getSystemName();\n\n ZoneId getId();\n\n \/**\n * Returns the virtual ID of this zone. For ordinary zones this is the same as {@link ZoneApi#getId()}, for a\n * system represented as a zone this is a fixed ID that is independent of the actual zone ID.\n *\/\n default ZoneId getVirtualId() {\n return getId();\n }\n\n default Environment getEnvironment() { return getId().environment(); }\n\n default RegionName getRegionName() { return getId().region(); }\n\n CloudName getCloudName();\n\n \/** Returns the region name within the cloud, e.g. 'us-east-1' in AWS *\/\n String getCloudNativeRegionName();\n\n}\n","new_contents":"\/\/ Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\npackage com.yahoo.config.provision.zone;\n\nimport com.yahoo.config.provision.CloudName;\nimport com.yahoo.config.provision.Environment;\nimport com.yahoo.config.provision.RegionName;\nimport com.yahoo.config.provision.SystemName;\n\n\/**\n * @author hakonhall\n *\/\npublic interface ZoneApi {\n\n SystemName getSystemName();\n\n ZoneId getId();\n\n \/** Returns the SYSTEM.ENVIRONMENT.REGION string. *\/\n default String getFullName() {\n return getSystemName().value() + \".\" + getEnvironment().value() + \".\" + getRegionName().value();\n }\n\n \/**\n * Returns the virtual ID of this zone. For ordinary zones this is the same as {@link ZoneApi#getId()}, for a\n * system represented as a zone this is a fixed ID that is independent of the actual zone ID.\n *\/\n default ZoneId getVirtualId() {\n return getId();\n }\n\n default Environment getEnvironment() { return getId().environment(); }\n\n default RegionName getRegionName() { return getId().region(); }\n\n CloudName getCloudName();\n\n \/** Returns the region name within the cloud, e.g. 'us-east-1' in AWS *\/\n String getCloudNativeRegionName();\n\n}\n","subject":"Add method to get SystemName.Environment.RegionName"} {"old_contents":"\/*\n * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0\n * (the \"License\"). You may not use this work except in compliance with the License, which is\n * available at www.apache.org\/licenses\/LICENSE-2.0\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n * either express or implied, as more fully set forth in the License.\n *\n * See the NOTICE file distributed with this work for information regarding copyright ownership.\n *\/\n\npackage alluxio.master.file;\n\nimport java.io.Closeable;\nimport java.io.IOException;\nimport java.util.Collection;\nimport java.util.List;\n\n\/**\n * Interface for a class which gathers block deletion requests, then handles them during close.\n *\/\npublic interface BlockDeletionContext extends Closeable {\n \/**\n * @param blockIds the blocks to be deleted when the context closes\n *\/\n default void registerBlocksForDeletion(Collection blockIds) {\n blockIds.forEach(id -> registerBlockForDeletion(id));\n }\n\n \/**\n * @param blockId the block to be deleted when the context closes\n *\/\n void registerBlockForDeletion(long blockId);\n\n \/**\n * Interface for block deletion listeners.\n *\/\n @FunctionalInterface\n interface BlockDeletionListener {\n \/**\n * Processes block deletion.\n *\n * @param blocks the deleted blocks\n *\/\n void process(List blocks) throws IOException;\n }\n}\n","new_contents":"\/*\n * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0\n * (the \"License\"). You may not use this work except in compliance with the License, which is\n * available at www.apache.org\/licenses\/LICENSE-2.0\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n * either express or implied, as more fully set forth in the License.\n *\n * See the NOTICE file distributed with this work for information regarding copyright ownership.\n *\/\n\npackage alluxio.master.file;\n\nimport java.io.Closeable;\nimport java.io.IOException;\nimport java.util.Collection;\nimport java.util.List;\n\n\/**\n * Interface for a class which gathers block deletion requests, then handles them during close.\n *\/\npublic interface BlockDeletionContext extends Closeable {\n \/**\n * @param blockIds the blocks to be deleted when the context closes\n *\/\n default void registerBlocksForDeletion(Collection blockIds) {\n blockIds.forEach(this::registerBlockForDeletion);\n }\n\n \/**\n * @param blockId the block to be deleted when the context closes\n *\/\n void registerBlockForDeletion(long blockId);\n\n \/**\n * Interface for block deletion listeners.\n *\/\n @FunctionalInterface\n interface BlockDeletionListener {\n \/**\n * Processes block deletion.\n *\n * @param blocks the deleted blocks\n *\/\n void process(List blocks) throws IOException;\n }\n}\n","subject":"Replace lambda with method reference"} {"old_contents":"\/*\n * Copyright 2013 MovingBlocks\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.terasology.world.propagation;\n\nimport org.terasology.math.geom.Vector3i;\nimport org.terasology.world.block.Block;\n\n\/**\n * A view providing access to the world for batch propagation\n *\n *\/\npublic interface PropagatorWorldView {\n\n byte UNAVAILABLE = -1;\n\n \/**\n * @param pos\n * @return The value of interest at pos, or UNAVAILABLE if out of bounds\n *\/\n byte getValueAt(Vector3i pos);\n\n \/**\n * @param pos\n * @param value A new value at pos.\n *\/\n void setValueAt(Vector3i pos, byte value);\n\n \/**\n * @param pos\n * @return The block at pos, or null if out of bounds\n *\/\n Block getBlockAt(Vector3i pos);\n\n}\n","new_contents":"\/*\n * Copyright 2013 MovingBlocks\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.terasology.world.propagation;\n\nimport org.terasology.math.geom.Vector3i;\nimport org.terasology.world.block.Block;\n\n\/**\n * A view providing access to the world specifically for batch propagation\n *\/\npublic interface PropagatorWorldView {\n\n byte UNAVAILABLE = -1;\n\n \/**\n * @return The value of interest at pos, or {@link #UNAVAILABLE} if out of bounds\n *\/\n byte getValueAt(Vector3i pos);\n\n \/**\n * @param value A new value at pos.\n *\/\n void setValueAt(Vector3i pos, byte value);\n\n \/**\n * @return The block at pos, or null if out of bounds\n *\/\n Block getBlockAt(Vector3i pos);\n\n}\n","subject":"Tweak javadoc for propogater world view interface"} {"old_contents":"package com.voodoodyne.gstrap.gae.test;\n\nimport com.voodoodyne.gstrap.test.util.TestInfoContextAdapter;\nimport org.junit.jupiter.api.extension.AfterEachCallback;\nimport org.junit.jupiter.api.extension.BeforeEachCallback;\nimport org.junit.jupiter.api.extension.ExtensionContext;\nimport org.junit.jupiter.api.extension.ExtensionContext.Namespace;\n\n\/**\n *\/\npublic class GAEExtension implements BeforeEachCallback, AfterEachCallback {\n\n\tprivate static final Namespace NAMESPACE = Namespace.create(GAEExtension.class);\n\n\t@Override\n\tpublic void beforeEach(final ExtensionContext context) throws Exception {\n\t\tfinal GAEHelper helper = new GAEHelper();\n\n\t\tcontext.getStore(NAMESPACE).put(GAEHelper.class, helper);\n\n\t\thelper.setUp(new TestInfoContextAdapter(context));\n\t}\n\n\t@Override\n\tpublic void afterEach(final ExtensionContext context) throws Exception {\n\t\tfinal GAEHelper helper = context.getStore(NAMESPACE).get(GAEHelper.class, GAEHelper.class);\n\t\thelper.tearDown();\n\t}\n}\n","new_contents":"package com.voodoodyne.gstrap.gae.test;\n\nimport com.voodoodyne.gstrap.test.util.TestInfoContextAdapter;\nimport org.junit.jupiter.api.extension.AfterEachCallback;\nimport org.junit.jupiter.api.extension.BeforeEachCallback;\nimport org.junit.jupiter.api.extension.ExtensionContext;\nimport org.junit.jupiter.api.extension.ExtensionContext.Namespace;\nimport org.junit.jupiter.api.extension.ExtensionContext.Store;\n\n\/**\n *\/\npublic class GAEExtension implements BeforeEachCallback, AfterEachCallback {\n\n\tprivate static final Namespace NAMESPACE = Namespace.create(GAEExtension.class);\n\n\t\/** Key in the store for the queue xml path. If not set, the maven default is used. *\/\n\tprivate static final String QUEUE_XML_PATH = \"queueXmlPath\";\n\n\t\/** Optionally override the queue xml path for the GAEHelper *\/\n\tpublic static void setQueueXmlPath(final ExtensionContext context, final String path) {\n\t\tcontext.getStore(NAMESPACE).put(QUEUE_XML_PATH, path);\n\t}\n\n\t@Override\n\tpublic void beforeEach(final ExtensionContext context) throws Exception {\n\t\tfinal Store store = context.getStore(NAMESPACE);\n\t\tfinal String queueXmlPath = store.get(QUEUE_XML_PATH, String.class);\n\n\t\tfinal GAEHelper helper = queueXmlPath == null ? new GAEHelper() : new GAEHelper(queueXmlPath);\n\n\t\tstore.put(GAEHelper.class, helper);\n\n\t\thelper.setUp(new TestInfoContextAdapter(context));\n\t}\n\n\t@Override\n\tpublic void afterEach(final ExtensionContext context) throws Exception {\n\t\tfinal GAEHelper helper = context.getStore(NAMESPACE).get(GAEHelper.class, GAEHelper.class);\n\t\thelper.tearDown();\n\t}\n}\n","subject":"Allow queue xml path to be set by prior extensions"} {"old_contents":"package com.hubspot.jackson.datatype.protobuf;\n\nimport com.google.protobuf.ExtensionRegistry;\n\npublic class ProtobufJacksonConfig {\n private final ExtensionRegistryWrapper extensionRegistry;\n private final boolean acceptLiteralFieldnames;\n\n private ProtobufJacksonConfig(ExtensionRegistryWrapper extensionRegistry, boolean acceptLiteralFieldnames) {\n this.extensionRegistry = extensionRegistry;\n this.acceptLiteralFieldnames = acceptLiteralFieldnames;\n }\n\n public static Builder builder() {\n return new Builder();\n }\n\n public ExtensionRegistryWrapper extensionRegistry() {\n return extensionRegistry;\n }\n\n public boolean acceptLiteralFieldnames() {\n return acceptLiteralFieldnames;\n }\n\n public static class Builder {\n private ExtensionRegistryWrapper extensionRegistry = ExtensionRegistryWrapper.empty();\n private boolean acceptLiteralFieldnames = true;\n\n private Builder() {}\n\n public Builder extensionRegistry(ExtensionRegistry extensionRegistry) {\n return extensionRegistry(ExtensionRegistryWrapper.wrap(extensionRegistry));\n }\n\n public Builder extensionRegistry(ExtensionRegistryWrapper extensionRegistry) {\n this.extensionRegistry = extensionRegistry;\n return this;\n }\n\n public Builder acceptLiteralFieldnames(boolean acceptLiteralFieldnames) {\n this.acceptLiteralFieldnames = acceptLiteralFieldnames;\n return this;\n }\n\n public ProtobufJacksonConfig build() {\n return new ProtobufJacksonConfig(extensionRegistry, acceptLiteralFieldnames);\n }\n }\n}\n","new_contents":"package com.hubspot.jackson.datatype.protobuf;\n\nimport com.google.protobuf.ExtensionRegistry;\n\npublic class ProtobufJacksonConfig {\n private final ExtensionRegistryWrapper extensionRegistry;\n private final boolean acceptLiteralFieldnames;\n\n private ProtobufJacksonConfig(ExtensionRegistryWrapper extensionRegistry, boolean acceptLiteralFieldnames) {\n this.extensionRegistry = extensionRegistry;\n this.acceptLiteralFieldnames = acceptLiteralFieldnames;\n }\n\n public static Builder builder() {\n return new Builder();\n }\n\n public ExtensionRegistryWrapper extensionRegistry() {\n return extensionRegistry;\n }\n\n public boolean acceptLiteralFieldnames() {\n return acceptLiteralFieldnames;\n }\n\n public static class Builder {\n private ExtensionRegistryWrapper extensionRegistry = ExtensionRegistryWrapper.empty();\n private boolean acceptLiteralFieldnames = false;\n\n private Builder() {}\n\n public Builder extensionRegistry(ExtensionRegistry extensionRegistry) {\n return extensionRegistry(ExtensionRegistryWrapper.wrap(extensionRegistry));\n }\n\n public Builder extensionRegistry(ExtensionRegistryWrapper extensionRegistry) {\n this.extensionRegistry = extensionRegistry;\n return this;\n }\n\n public Builder acceptLiteralFieldnames(boolean acceptLiteralFieldnames) {\n this.acceptLiteralFieldnames = acceptLiteralFieldnames;\n return this;\n }\n\n public ProtobufJacksonConfig build() {\n return new ProtobufJacksonConfig(extensionRegistry, acceptLiteralFieldnames);\n }\n }\n}\n","subject":"Change the default to false"} {"old_contents":"\/\/ Copyright (C) 2017 The Android Open Source Project\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.google.gerrit.server.git.receive;\n\nimport com.google.common.annotations.VisibleForTesting;\n\npublic final class ReceiveConstants {\n public static final String PUSH_OPTION_SKIP_VALIDATION = \"skip-validation\";\n\n @VisibleForTesting\n public static final String ONLY_USERS_WITH_TOGGLE_WIP_STATE_PERM_CAN_MODIFY_WIP =\n \"only users with Toogle-Wip-State permission can modify Work-in-Progress\";\n\n static final String COMMAND_REJECTION_MESSAGE_FOOTER =\n \"Contact an administrator to fix the permissions\";\n\n static final String SAME_CHANGE_ID_IN_MULTIPLE_CHANGES =\n \"same Change-Id in multiple changes.\\n\"\n + \"Squash the commits with the same Change-Id or \"\n + \"ensure Change-Ids are unique for each commit\";\n\n private ReceiveConstants() {}\n}\n","new_contents":"\/\/ Copyright (C) 2017 The Android Open Source Project\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.google.gerrit.server.git.receive;\n\nimport com.google.common.annotations.VisibleForTesting;\n\npublic final class ReceiveConstants {\n public static final String PUSH_OPTION_SKIP_VALIDATION = \"skip-validation\";\n\n @VisibleForTesting\n public static final String ONLY_USERS_WITH_TOGGLE_WIP_STATE_PERM_CAN_MODIFY_WIP =\n \"only users with Toggle-Wip-State permission can modify Work-in-Progress\";\n\n static final String COMMAND_REJECTION_MESSAGE_FOOTER =\n \"Contact an administrator to fix the permissions\";\n\n static final String SAME_CHANGE_ID_IN_MULTIPLE_CHANGES =\n \"same Change-Id in multiple changes.\\n\"\n + \"Squash the commits with the same Change-Id or \"\n + \"ensure Change-Ids are unique for each commit\";\n\n private ReceiveConstants() {}\n}\n","subject":"Fix typo in error message"} {"old_contents":"\/*\n * MIT License\n *\n * Copyright (c) 2020 Jannis Weis\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and\n * associated documentation files (the \"Software\"), to deal in the Software without restriction,\n * including without limitation the rights to use, copy, modify, merge, publish, distribute,\n * sublicense, and\/or sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or\n * substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT\n * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n *\/\npackage com.github.weisj.darklaf.settings;\n\nimport java.awt.*;\n\nimport javax.swing.*;\n\npublic class ThemeSettingsMenuItem extends JMenuItem {\n\n public ThemeSettingsMenuItem(final String text) {\n super(text);\n setIcon(ThemeSettings.getInstance().getIcon());\n addActionListener(e -> ThemeSettings.showSettingsDialog(this));\n }\n}\n","new_contents":"\/*\n * MIT License\n *\n * Copyright (c) 2020 Jannis Weis\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and\n * associated documentation files (the \"Software\"), to deal in the Software without restriction,\n * including without limitation the rights to use, copy, modify, merge, publish, distribute,\n * sublicense, and\/or sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or\n * substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT\n * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n *\/\npackage com.github.weisj.darklaf.settings;\n\nimport javax.swing.*;\n\npublic class ThemeSettingsMenuItem extends JMenuItem {\n\n public ThemeSettingsMenuItem(final String text) {\n super(text);\n setIcon(ThemeSettings.getIcon());\n addActionListener(e -> ThemeSettings.showSettingsDialog(this));\n }\n}\n","subject":"Remove static access on instance."} {"old_contents":"\/*-\n * #%L\n * SciJava polyglot kernel for Jupyter.\n * %%\n * Copyright (C) 2017 Hadrien Mary\n * %%\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * #L%\n *\/\n\npackage org.scijava.notebook.converter;\n\nimport org.scijava.Priority;\nimport org.scijava.convert.Converter;\nimport org.scijava.notebook.converter.ouput.HTMLNotebookOutput;\nimport org.scijava.plugin.Plugin;\n\n@Plugin(type = Converter.class, priority = Priority.LOW_PRIORITY)\npublic class StringToHTMLNotebookConverter\n extends NotebookOutputConverter {\n\n @Override\n public Class getInputType() {\n return String.class;\n }\n\n @Override\n public Class getOutputType() {\n return HTMLNotebookOutput.class;\n }\n\n @Override\n public HTMLNotebookOutput convert(Object object) {\n return new HTMLNotebookOutput(HTMLNotebookOutput.getMimeType(),\n (String) object);\n }\n\n}\n","new_contents":"\/*-\n * #%L\n * SciJava polyglot kernel for Jupyter.\n * %%\n * Copyright (C) 2017 Hadrien Mary\n * %%\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * #L%\n *\/\n\npackage org.scijava.notebook.converter;\n\nimport org.apache.commons.lang3.StringEscapeUtils;\nimport org.scijava.Priority;\nimport org.scijava.convert.Converter;\nimport org.scijava.notebook.converter.ouput.HTMLNotebookOutput;\nimport org.scijava.plugin.Plugin;\n\n@Plugin(type = Converter.class, priority = Priority.LOW_PRIORITY)\npublic class StringToHTMLNotebookConverter\n extends NotebookOutputConverter {\n\n @Override\n public Class getInputType() {\n return String.class;\n }\n\n @Override\n public Class getOutputType() {\n return HTMLNotebookOutput.class;\n }\n\n @Override\n public HTMLNotebookOutput convert(Object object) {\n return new HTMLNotebookOutput(HTMLNotebookOutput.getMimeType(),\n StringEscapeUtils.escapeHtml4((String) object));\n }\n\n}\n","subject":"Fix converter to escape HTML characters"} {"old_contents":"package com.ferreusveritas.dynamictrees;\n\npublic class ModConstants {\n\t\n\tpublic static final String MODID = \"dynamictrees\";\n\tpublic static final String NAME = \"Dynamic Trees\";\n\tpublic static final String VERSIONDEV = \"1.12.2-9.9.9z\";\n\tpublic static final String VERSIONAUTO = \"@VERSION@\";\n\tpublic static final String VERSION = VERSIONDEV;\n\t\n\tpublic static final String AFTER = \"after:\";\n\tpublic static final String BEFORE = \"before:\";\n\tpublic static final String NEXT = \";\";\n\t\n\t\/\/Other mods can use this string to depend on the latest version of Dynamic Trees\n\tpublic static final String DYNAMICTREES_LATEST = MODID + \"@[\" + VERSION + \",)\";\n\t\n\t\/\/Other Mods\n\tpublic static final String DYNAMICTREESBOP = \"dynamictreesbop\";\n\tpublic static final String DYNAMICTREESTC = \"dynamictreestc\";\n\t\n\t\/\/Other Mods\n\tpublic static final String DYNAMICTREESBOP_VER = \"@[1.3.1b,)\";\n\tpublic static final String DYNAMICTREESTC_VER = \"@[1.0,)\";\n\t\n\tpublic static final String DEPENDENCIES\n\t\t= BEFORE + DYNAMICTREESBOP + DYNAMICTREESBOP_VER\n\t\t+ NEXT\n\t\t+ BEFORE + DYNAMICTREESTC + DYNAMICTREESTC_VER\n\t\t;\n\t\n}\n","new_contents":"package com.ferreusveritas.dynamictrees;\n\npublic class ModConstants {\n\t\n\tpublic static final String MODID = \"dynamictrees\";\n\tpublic static final String NAME = \"Dynamic Trees\";\n\tpublic static final String VERSIONDEV = \"1.12.2-9.9.9z\";\n\tpublic static final String VERSIONAUTO = \"@VERSION@\";\n\tpublic static final String VERSION = VERSIONAUTO;\n\t\n\tpublic static final String AFTER = \"after:\";\n\tpublic static final String BEFORE = \"before:\";\n\tpublic static final String NEXT = \";\";\n\t\n\t\/\/Other mods can use this string to depend on the latest version of Dynamic Trees\n\tpublic static final String DYNAMICTREES_LATEST = MODID + \"@[\" + VERSION + \",)\";\n\t\n\t\/\/Other Mods\n\tpublic static final String DYNAMICTREESBOP = \"dynamictreesbop\";\n\tpublic static final String DYNAMICTREESTC = \"dynamictreestc\";\n\t\n\t\/\/Other Mods\n\tpublic static final String DYNAMICTREESBOP_VER = \"@[1.3.1b,)\";\n\tpublic static final String DYNAMICTREESTC_VER = \"@[1.0,)\";\n\t\n\tpublic static final String DEPENDENCIES\n\t\t= BEFORE + DYNAMICTREESBOP + DYNAMICTREESBOP_VER\n\t\t+ NEXT\n\t\t+ BEFORE + DYNAMICTREESTC + DYNAMICTREESTC_VER\n\t\t;\n\t\n}\n","subject":"Change version to \"auto\" mode"} {"old_contents":"package jltools.frontend;\n\nimport jltools.ast.*;\nimport jltools.util.*;\n\n\/** A pass which runs a visitor. *\/\npublic class VisitorPass extends AbstractPass\n{\n Job job;\n NodeVisitor v;\n\n public VisitorPass(Job job) {\n\tthis(job, null);\n }\n\n public VisitorPass(Job job, NodeVisitor v) {\n\tthis.job = job;\n\tthis.v = v;\n }\n\n public void visitor(NodeVisitor v) {\n\tthis.v = v;\n }\n\n public NodeVisitor visitor() {\n\treturn v;\n }\n\n public boolean run() {\n\tNode ast = job.ast();\n\n\tif (ast == null) {\n\t throw new InternalCompilerError(\"Null AST: did the parser run?\");\n\t}\n\n ErrorQueue q = job.compiler().errorQueue();\n int nErrsBefore = q.errorCount();\n\n\tast = ast.visit(v);\n v.finish();\n\n int nErrsAfter = q.errorCount();\n\n\tjob.ast(ast);\n\n return (nErrsBefore == nErrsAfter);\n \/\/ because, if they're equal, no new errors occured,\n \/\/ so the run was successful.\n }\n\n public String toString() {\n\treturn v.getClass().getName() + \"(\" + job + \")\";\n }\n}\n","new_contents":"package jltools.frontend;\n\nimport jltools.ast.*;\nimport jltools.util.*;\n\n\/** A pass which runs a visitor. *\/\npublic class VisitorPass extends AbstractPass\n{\n Job job;\n NodeVisitor v;\n\n public VisitorPass(Job job) {\n\tthis(job, null);\n }\n\n public VisitorPass(Job job, NodeVisitor v) {\n\tthis.job = job;\n\tthis.v = v;\n }\n\n public void visitor(NodeVisitor v) {\n\tthis.v = v;\n }\n\n public NodeVisitor visitor() {\n\treturn v;\n }\n\n public boolean run() {\n\tNode ast = job.ast();\n\n\tif (ast == null) {\n\t throw new InternalCompilerError(\"Null AST: did the parser run?\");\n\t}\n\n if (v.begin()) {\n ErrorQueue q = job.compiler().errorQueue();\n int nErrsBefore = q.errorCount();\n\n ast = ast.visit(v);\n v.finish();\n\n int nErrsAfter = q.errorCount();\n\n job.ast(ast);\n\n return (nErrsBefore == nErrsAfter);\n \/\/ because, if they're equal, no new errors occured,\n \/\/ so the run was successful.\n }\n\n return false;\n }\n\n public String toString() {\n\treturn v.getClass().getName() + \"(\" + job + \")\";\n }\n}\n","subject":"Call NodeVisitor.begin() before visiting ast."} {"old_contents":"package hu.webarticum.treeprinter.decorator;\n\nimport hu.webarticum.treeprinter.TreeNode;\n\npublic class TrackingTreeNodeDecorator extends AbstractTreeNodeDecorator {\n\n public final TrackingTreeNodeDecorator parent;\n \n public final int index;\n \n\n public TrackingTreeNodeDecorator(TreeNode baseNode) {\n this(baseNode, null, 0);\n }\n \n public TrackingTreeNodeDecorator(TreeNode baseNode, TrackingTreeNodeDecorator parent, int index) {\n super(baseNode);\n this.parent = parent;\n this.index = index;\n }\n\n \n @Override\n public String content() {\n return decoratedNode.content();\n }\n\n @Override\n protected TreeNode decorateChild(TreeNode childNode, int index) {\n return new TrackingTreeNodeDecorator(childNode, this, index);\n }\n\n @Override\n public boolean isDecorable() {\n return false;\n }\n \n @Override\n public int hashCode() {\n int parentHashCode = parent != null ? parent.hashCode(): 0;\n return (parentHashCode * 37) + index;\n }\n \n @Override\n public boolean equals(Object other) {\n if (!(other instanceof TrackingTreeNodeDecorator)) {\n return false;\n }\n\n TrackingTreeNodeDecorator otherReferenceTreeNode = (TrackingTreeNodeDecorator) other;\n TrackingTreeNodeDecorator otherParent = otherReferenceTreeNode.parent;\n \n if (this == otherReferenceTreeNode) {\n return true;\n } else if (parent == null) {\n if (otherParent != null) {\n return false;\n }\n } else if (otherParent == null || !parent.equals(otherParent)) {\n return false;\n }\n \n return index == otherReferenceTreeNode.index;\n }\n \n}\n","new_contents":"package hu.webarticum.treeprinter.decorator;\n\nimport hu.webarticum.treeprinter.TreeNode;\n\npublic class TrackingTreeNodeDecorator extends AbstractTreeNodeDecorator {\n\n public final TrackingTreeNodeDecorator parent;\n \n public final int index;\n \n\n public TrackingTreeNodeDecorator(TreeNode baseNode) {\n this(baseNode, null, 0);\n }\n \n public TrackingTreeNodeDecorator(TreeNode baseNode, TrackingTreeNodeDecorator parent, int index) {\n super(baseNode);\n this.parent = parent;\n this.index = index;\n }\n\n \n @Override\n public String content() {\n return decoratedNode.content();\n }\n\n @Override\n protected TreeNode decorateChild(TreeNode childNode, int index) {\n return new TrackingTreeNodeDecorator(childNode, this, index);\n }\n\n @Override\n public boolean isDecorable() {\n return false;\n }\n \n @Override\n public int hashCode() {\n int parentHashCode = parent != null ? parent.hashCode(): 0;\n return (parentHashCode * 37) + index;\n }\n \n @Override\n public boolean equals(Object other) {\n if (!(other instanceof TrackingTreeNodeDecorator)) {\n return false;\n }\n\n TrackingTreeNodeDecorator otherTrackingTreeNodeDecorator = (TrackingTreeNodeDecorator) other;\n TrackingTreeNodeDecorator otherParent = otherTrackingTreeNodeDecorator.parent;\n \n if (this == otherTrackingTreeNodeDecorator) {\n return true;\n } else if (parent == null) {\n if (otherParent != null) {\n return false;\n }\n } else if (otherParent == null || !parent.equals(otherParent)) {\n return false;\n }\n \n return index == otherTrackingTreeNodeDecorator.index;\n }\n \n}\n","subject":"Rename a variable in TrackingTreeNodeDecocator"} {"old_contents":"package com.annimon.jecp.me;\r\n\r\nimport com.annimon.jecp.ApplicationListener;\r\nimport javax.microedition.midlet.MIDlet;\r\n\r\n\/**\r\n *\r\n * @author aNNiMON\r\n *\/\r\npublic abstract class JecpMidlet extends MIDlet implements ApplicationListener {\r\n\r\n protected final void startApp() {\r\n onCreate();\r\n }\r\n\r\n protected final void pauseApp() {\r\n onPause();\r\n }\r\n\r\n protected final void destroyApp(boolean unconditional) {\r\n onExit();\r\n }\r\n}\r\n","new_contents":"package com.annimon.jecp.me;\r\n\r\nimport com.annimon.jecp.ApplicationListener;\r\nimport javax.microedition.midlet.MIDlet;\r\n\r\n\/**\r\n *\r\n * @author aNNiMON\r\n *\/\r\npublic abstract class JecpMidlet extends MIDlet implements ApplicationListener {\r\n\r\n protected final void startApp() {\r\n onStartApp();\r\n }\r\n\r\n protected final void pauseApp() {\r\n onPauseApp();\r\n }\r\n\r\n protected final void destroyApp(boolean unconditional) {\r\n onDestroyApp();\r\n }\r\n}\r\n","subject":"Fix method name in Java ME library"} {"old_contents":"package org.tenidwa.collections.utils;\n\nimport com.google.common.collect.ImmutableList;\nimport com.google.common.collect.ImmutableSet;\nimport java.util.Arrays;\nimport java.util.LinkedHashSet;\nimport org.junit.Assert;\nimport org.junit.Test;\n\npublic final class CollectorsTest {\n @Test\n public void toImmutableSet() {\n Assert.assertEquals(\n ImmutableSet.of(1, 2, 3),\n Arrays.asList(1, 2, 3).stream()\n .collect(Collectors.toImmutableSet())\n );\n }\n\n @Test\n public void toImmutableList() {\n Assert.assertEquals(\n ImmutableList.of(1, 2, 3),\n Arrays.asList(1, 2, 3).stream()\n .collect(Collectors.toImmutableList())\n );\n }\n\n @Test\n public void toLinkedHashSet() {\n Assert.assertEquals(\n new LinkedHashSet() {\n {\n add(1);\n add(2);\n add(3);\n }\n },\n Arrays.asList(1, 2, 3).stream()\n .collect(Collectors.toLinkedHashSet())\n );\n }\n}\n","new_contents":"package org.tenidwa.collections.utils;\n\nimport com.google.common.collect.ImmutableList;\nimport com.google.common.collect.ImmutableSet;\nimport java.util.Arrays;\nimport java.util.LinkedHashSet;\nimport org.junit.Assert;\nimport org.junit.Test;\n\npublic final class CollectorsTest {\n @Test\n public void toImmutableSet() {\n Assert.assertEquals(\n ImmutableSet.of(1, 2, 3),\n Arrays.asList(1, 2, 3).stream()\n .collect(Collectors.toImmutableSet())\n );\n }\n\n @Test\n public void toImmutableList() {\n Assert.assertEquals(\n ImmutableList.of(1, 2, 3),\n Arrays.asList(1, 2, 3).stream()\n .collect(Collectors.toImmutableList())\n );\n }\n\n @Test\n public void toLinkedHashSet() {\n final LinkedHashSet expected = new LinkedHashSet<>();\n expected.add(1);\n expected.add(2);\n expected.add(3);\n Assert.assertEquals(\n expected,\n Arrays.asList(1, 2, 3).stream()\n .collect(Collectors.toLinkedHashSet())\n );\n }\n}\n","subject":"Change the way an expected set is instantated in a test"} {"old_contents":"package org.apereo.cas.services;\n\nimport org.apereo.cas.util.services.RegisteredServiceJsonSerializer;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.springframework.context.ApplicationEventPublisher;\nimport org.springframework.core.io.ClassPathResource;\n\nimport static org.junit.Assert.*;\nimport static org.mockito.Mockito.*;\n\n\/**\n * Handles test cases for {@link JsonServiceRegistryDao}.\n *\n * @author Misagh Moayyed\n * @since 4.1.0\n *\/\npublic class JsonServiceRegistryDaoTests extends AbstractResourceBasedServiceRegistryDaoTests {\n\n @Before\n public void setUp() {\n try {\n this.dao = new JsonServiceRegistryDao(RESOURCE, false, mock(ApplicationEventPublisher.class));\n } catch (final Exception e) {\n throw new IllegalArgumentException(e);\n }\n }\n\n @Test\n public void verifyLegacyServiceDefn() throws Exception {\n final ClassPathResource resource = new ClassPathResource(\"Legacy-10000003.json\");\n final RegisteredServiceJsonSerializer serializer = new RegisteredServiceJsonSerializer();\n final RegisteredService service = serializer.from(resource.getInputStream());\n assertNotNull(service);\n }\n}\n","new_contents":"package org.apereo.cas.services;\n\nimport org.apereo.cas.util.services.RegisteredServiceJsonSerializer;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.springframework.context.ApplicationEventPublisher;\nimport org.springframework.core.io.ClassPathResource;\nimport org.springframework.core.io.Resource;\n\nimport java.io.IOException;\n\nimport static org.junit.Assert.*;\nimport static org.mockito.Mockito.*;\n\n\/**\n * Handles test cases for {@link JsonServiceRegistryDao}.\n *\n * @author Misagh Moayyed\n * @since 4.1.0\n *\/\npublic class JsonServiceRegistryDaoTests extends AbstractResourceBasedServiceRegistryDaoTests {\n\n @Before\n public void setUp() {\n try {\n this.dao = new JsonServiceRegistryDao(RESOURCE, false, mock(ApplicationEventPublisher.class));\n } catch (final Exception e) {\n throw new IllegalArgumentException(e);\n }\n }\n\n @Test\n public void verifyLegacyServiceDefn() throws Exception {\n final ClassPathResource resource = new ClassPathResource(\"Legacy-10000003.json\");\n final RegisteredServiceJsonSerializer serializer = new RegisteredServiceJsonSerializer();\n final RegisteredService service = serializer.from(resource.getInputStream());\n assertNotNull(service);\n }\n\n @Test\n public void verifyExistingDefinitionForCompatibility() throws IOException {\n final Resource resource = new ClassPathResource(\"returnMappedAttributeReleasePolicyTest1.json\");\n final RegisteredServiceJsonSerializer serializer = new RegisteredServiceJsonSerializer();\n final RegisteredService service = serializer.from(resource.getInputStream());\n assertNotNull(service);\n }\n}\n","subject":"Clean up transformations of multimaps into JSON"} {"old_contents":"\/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.facebook.presto.raptor.storage;\n\nimport com.google.inject.Binder;\nimport com.google.inject.Module;\nimport com.google.inject.Provides;\nimport com.google.inject.Scopes;\nimport io.airlift.dbpool.H2EmbeddedDataSource;\nimport io.airlift.dbpool.H2EmbeddedDataSourceConfig;\nimport io.airlift.units.Duration;\nimport org.skife.jdbi.v2.DBI;\nimport org.skife.jdbi.v2.IDBI;\n\nimport javax.inject.Singleton;\n\nimport java.io.File;\n\nimport static io.airlift.configuration.ConfigurationModule.bindConfig;\nimport static java.util.concurrent.TimeUnit.SECONDS;\n\npublic class StorageModule\n implements Module\n{\n @Override\n public void configure(Binder binder)\n {\n bindConfig(binder).to(StorageManagerConfig.class);\n binder.bind(StorageManager.class).to(OrcStorageManager.class).in(Scopes.SINGLETON);\n }\n\n @Provides\n @Singleton\n @ForStorageManager\n public IDBI createLocalStorageManagerDBI(StorageManagerConfig config)\n throws Exception\n {\n return new DBI(new H2EmbeddedDataSource(new H2EmbeddedDataSourceConfig()\n .setFilename(new File(config.getDataDirectory(), \"db\/StorageManager\").getAbsolutePath())\n .setMaxConnections(500)\n .setMaxConnectionWait(new Duration(1, SECONDS))));\n }\n}\n","new_contents":"\/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.facebook.presto.raptor.storage;\n\nimport com.google.inject.Binder;\nimport com.google.inject.Module;\nimport com.google.inject.Scopes;\n\nimport static io.airlift.configuration.ConfigurationModule.bindConfig;\n\npublic class StorageModule\n implements Module\n{\n @Override\n public void configure(Binder binder)\n {\n bindConfig(binder).to(StorageManagerConfig.class);\n binder.bind(StorageManager.class).to(OrcStorageManager.class).in(Scopes.SINGLETON);\n }\n}\n","subject":"Remove unused StorageManager H2 database"} {"old_contents":"\/*\n * (C) Copyright IBM Corporation 2016\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.ibm.ws.microprofile.sample.conference.vote.model;\n\npublic class Attendee {\n\n\tprivate String id;\n\tprivate final String revision;\n\tprivate final String name;\n\t\n\tpublic Attendee(String name) {\n\t\tthis(null, null, name);\n\t}\n\n\tpublic Attendee(String id, String name) {\n\t\tthis(id, null, name);\n\t}\n\t\n\tpublic Attendee(String id, String revision, String name) {\n\t\tthis.id = id;\n\t\tthis.revision = revision;\n\t\tthis.name = name;\n\t}\n\t\n\tpublic String getId() {\n\t\treturn id;\n\t}\n\t\n\tpublic void setID(String id) {\n\t\tthis.id = id;\n\t}\n\t\n\tpublic String getRevision() {\n\t\treturn revision;\n\t}\n\t\n\tpublic String getName() {\n\t\treturn name;\n\t}\n}\n","new_contents":"\/*\n * (C) Copyright IBM Corporation 2016\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.ibm.ws.microprofile.sample.conference.vote.model;\n\npublic class Attendee {\n\n\tprivate String id;\n\tprivate final String revision;\n\tprivate String name;\n\t\n\tpublic Attendee(String name) {\n\t\tthis(null, null, name);\n\t}\n\n\tpublic Attendee(String id, String name) {\n\t\tthis(id, null, name);\n\t}\n\t\n\tpublic Attendee(String id, String revision, String name) {\n\t\tthis.id = id;\n\t\tthis.revision = revision;\n\t\tthis.name = name;\n\t}\n\t\n\tpublic String getId() {\n\t\treturn id;\n\t}\n\t\n\tpublic void setID(String id) {\n\t\tthis.id = id;\n\t}\n\t\n\tpublic String getRevision() {\n\t\treturn revision;\n\t}\n\t\n\tpublic String getName() {\n\t\treturn name;\n\t}\n\t\n\tpublic void setName(String name) {\n\t\tthis.name = name;\n\t}\n}\n","subject":"Put the setName method back again"} {"old_contents":"package org.innovateuk.ifs.publiccontent.saver.section;\n\n\nimport org.innovateuk.ifs.commons.error.Error;\nimport org.innovateuk.ifs.competition.publiccontent.resource.FundingType;\nimport org.innovateuk.ifs.competition.publiccontent.resource.PublicContentResource;\nimport org.innovateuk.ifs.competition.publiccontent.resource.PublicContentSectionType;\nimport org.innovateuk.ifs.publiccontent.form.section.SummaryForm;\nimport org.innovateuk.ifs.publiccontent.saver.AbstractContentGroupFormSaver;\nimport org.innovateuk.ifs.publiccontent.saver.PublicContentFormSaver;\nimport org.springframework.stereotype.Service;\n\nimport java.util.List;\n\n\/**\n * Saver for the Summary form on public content setup.\n *\/\n@Service\npublic class SummaryFormSaver extends AbstractContentGroupFormSaver implements PublicContentFormSaver {\n\n @Override\n protected List populateResource(SummaryForm form, PublicContentResource publicContentResource) {\n publicContentResource.setSummary(form.getDescription());\n publicContentResource.setFundingType(FundingType.fromDisplayName(form.getFundingType()));\n publicContentResource.setProjectSize(form.getProjectSize());\n return super.populateResource(form, publicContentResource);\n }\n\n @Override\n protected PublicContentSectionType getType() {\n return PublicContentSectionType.SUMMARY;\n }\n}\n","new_contents":"package org.innovateuk.ifs.publiccontent.saver.section;\n\n\nimport org.innovateuk.ifs.commons.error.Error;\nimport org.innovateuk.ifs.competition.publiccontent.resource.FundingType;\nimport org.innovateuk.ifs.competition.publiccontent.resource.PublicContentResource;\nimport org.innovateuk.ifs.competition.publiccontent.resource.PublicContentSectionType;\nimport org.innovateuk.ifs.publiccontent.form.section.SummaryForm;\nimport org.innovateuk.ifs.publiccontent.saver.AbstractContentGroupFormSaver;\nimport org.innovateuk.ifs.publiccontent.saver.PublicContentFormSaver;\nimport org.springframework.stereotype.Service;\n\nimport java.util.Collections;\nimport java.util.List;\n\n\/**\n * Saver for the Summary form on public content setup.\n *\/\n@Service\npublic class SummaryFormSaver extends AbstractContentGroupFormSaver implements PublicContentFormSaver {\n\n @Override\n protected List populateResource(SummaryForm form, PublicContentResource publicContentResource) {\n publicContentResource.setSummary(form.getDescription());\n publicContentResource.setFundingType(FundingType.fromDisplayName(form.getFundingType()));\n publicContentResource.setProjectSize(form.getProjectSize());\n return Collections.emptyList();\n }\n\n @Override\n protected PublicContentSectionType getType() {\n return PublicContentSectionType.SUMMARY;\n }\n}\n","subject":"Fix submit action on public content summary page"} {"old_contents":"package com.github.ryanbrainard.richsobjects.api.client;\n\n\/**\n * @author Ryan Brainard\n *\/\npublic class SfdcApiTestSessionProvider implements SfdcApiSessionProvider {\n \n @Override\n public String getAccessToken() {\n return System.getProperty(\"sfdc.test.sessionId\");\n }\n\n @Override\n public String getApiEndpoint() {\n return System.getProperty(\"sfdc.test.endpoint\");\n }\n}\n","new_contents":"package com.github.ryanbrainard.richsobjects.api.client;\n\n\/**\n * @author Ryan Brainard\n *\/\npublic class SfdcApiTestSessionProvider implements SfdcApiSessionProvider {\n \n @Override\n public String getAccessToken() {\n return getSystemPropertyOrEnvVar(\"sfdc.test.sessionId\", \"SFDC_TEST_SESSION_ID\");\n }\n\n @Override\n public String getApiEndpoint() {\n return getSystemPropertyOrEnvVar(\"sfdc.test.endpoint\", \"SFDC_TEST_ENDPOINT\");\n }\n\n private static String getSystemPropertyOrEnvVar(String systemProperty, String envVar) {\n if (System.getProperties().containsKey(systemProperty)) {\n return System.getProperty(systemProperty);\n } else if (System.getenv().containsKey(envVar)) {\n return System.getenv(envVar);\n } else {\n throw new RuntimeException(\"Could not log system property [\" + systemProperty + \"]\" +\n \" or environment variable [\" + envVar + \"]\");\n }\n }\n}\n","subject":"Allow test session and endpoint to come from env vars"} {"old_contents":"\/*\n * Copyright 2012-2022 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.springframework.boot.docs.features.testing.springbootapplications.jmx;\n\nimport javax.management.MBeanServer;\n\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtendWith;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.annotation.DirtiesContext;\nimport org.springframework.test.context.junit.jupiter.SpringExtension;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@ExtendWith(SpringExtension.class)\n@SpringBootTest(properties = \"spring.jmx.enabled=true\")\n@DirtiesContext\nclass MyJmxTests {\n\n\t@Autowired\n\tprivate MBeanServer mBeanServer;\n\n\t@Test\n\tvoid exampleTest() {\n\t\tassertThat(this.mBeanServer.getDomains()).contains(\"java.lang\");\n\t\t\/\/ ...\n\t}\n\n}\n","new_contents":"\/*\n * Copyright 2012-2022 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.springframework.boot.docs.features.testing.springbootapplications.jmx;\n\nimport javax.management.MBeanServer;\n\nimport org.junit.jupiter.api.Test;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.annotation.DirtiesContext;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@SpringBootTest(properties = \"spring.jmx.enabled=true\")\n@DirtiesContext\nclass MyJmxTests {\n\n\t@Autowired\n\tprivate MBeanServer mBeanServer;\n\n\t@Test\n\tvoid exampleTest() {\n\t\tassertThat(this.mBeanServer.getDomains()).contains(\"java.lang\");\n\t\t\/\/ ...\n\t}\n\n}\n","subject":"Remove redundant @ExtendWith(SpringExtension.class) for sample"} {"old_contents":"package com.gabrielavara.choiceplayer.playlist;\n\nimport com.gabrielavara.choiceplayer.dto.Mp3;\nimport com.gabrielavara.choiceplayer.messages.SelectionChangedMessage;\nimport com.gabrielavara.choiceplayer.messenger.Messenger;\nimport com.gabrielavara.choiceplayer.util.Opinion;\nimport com.gabrielavara.choiceplayer.views.PlaylistItemView;\nimport javafx.beans.value.ChangeListener;\nimport javafx.beans.value.ObservableValue;\nimport lombok.Setter;\n\nimport java.util.Optional;\n\npublic class PlaylistSelectionChangedListener implements ChangeListener {\n @Setter\n @SuppressWarnings(\"OptionalUsedAsFieldOrParameterType\")\n private Optional opinion = Optional.empty();\n\n @Override\n public void changed(ObservableValue observable, PlaylistItemView oldValue, PlaylistItemView newValue) {\n if (newValue == null) {\n return;\n }\n changed(oldValue == null ? null : oldValue.getMp3(), newValue.getMp3(), oldValue);\n }\n\n private void changed(Mp3 oldValue, Mp3 newValue, PlaylistItemView oldItemView) {\n Messenger.send(new SelectionChangedMessage(newValue, oldValue, oldItemView, true, opinion));\n }\n}\n","new_contents":"package com.gabrielavara.choiceplayer.playlist;\n\nimport com.gabrielavara.choiceplayer.dto.Mp3;\nimport com.gabrielavara.choiceplayer.messages.SelectionChangedMessage;\nimport com.gabrielavara.choiceplayer.messenger.Messenger;\nimport com.gabrielavara.choiceplayer.util.Opinion;\nimport com.gabrielavara.choiceplayer.views.PlaylistItemView;\nimport javafx.beans.value.ChangeListener;\nimport javafx.beans.value.ObservableValue;\n\nimport java.util.Optional;\n\npublic class PlaylistSelectionChangedListener implements ChangeListener {\n @SuppressWarnings(\"OptionalUsedAsFieldOrParameterType\")\n private Optional opinion = Optional.empty();\n private boolean opinionSet;\n\n @SuppressWarnings(\"OptionalUsedAsFieldOrParameterType\")\n public void setOpinion(Optional opinion) {\n this.opinion = opinion;\n opinionSet = true;\n }\n\n @Override\n public void changed(ObservableValue observable, PlaylistItemView oldValue, PlaylistItemView newValue) {\n if (newValue == null) {\n return;\n }\n changed(oldValue == null ? null : oldValue.getMp3(), newValue.getMp3(), oldValue);\n }\n\n private void changed(Mp3 oldValue, Mp3 newValue, PlaylistItemView oldItemView) {\n if (!opinionSet) {\n opinion = Optional.empty();\n }\n Messenger.send(new SelectionChangedMessage(newValue, oldValue, oldItemView, true, opinion));\n opinionSet = false;\n }\n}\n","subject":"Fix for changing selection with mouse"} {"old_contents":"package com.github.steveice10.mc.protocol.data.game.world.block;\n\npublic enum UpdatedTileType {\n MOB_SPAWNER,\n COMMAND_BLOCK,\n BEACON,\n SKULL,\n CONDUIT,\n BANNER,\n STRUCTURE_BLOCK,\n END_GATEWAY,\n SIGN,\n SHULKER_BOX,\n BED;\n}\n","new_contents":"package com.github.steveice10.mc.protocol.data.game.world.block;\n\npublic enum UpdatedTileType {\n MOB_SPAWNER,\n COMMAND_BLOCK,\n BEACON,\n SKULL,\n CONDUIT,\n BANNER,\n STRUCTURE_BLOCK,\n END_GATEWAY,\n SIGN,\n @Deprecated\n SHULKER_BOX,\n BED,\n JIGSAW_BLOCK,\n CAMPFIRE;\n}\n","subject":"Add new Types for UpdatedTiles"} {"old_contents":"package nl.hsac.fitnesse.fixture.util;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertNull;\n\npublic class HtmlCleanerTest {\n private final HtmlCleaner cleaner = new HtmlCleaner();\n\n @Test\n public void testCleanUrl() {\n assertEquals(\"http:\/\/hallo.com\/test\", cleaner.getUrl(\"http:\/\/hallo.com\/test\"));\n assertEquals(\"http:\/\/hallo.com\/test2\", cleaner.getUrl(\"Hallo<\/a>\"));\n assertEquals(\"http:\/\/hallo.com\/test3?testparam=1\", cleaner.getUrl(\"Hallo2<\/a>\"));\n assertEquals(\"http:\/\/hallo.com\/test3?testparam=1¶m2=3\", cleaner.getUrl(\"Hallo3<\/a>\"));\n\n assertNull(cleaner.getUrl(null));\n }\n}\n","new_contents":"package nl.hsac.fitnesse.fixture.util;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertNull;\n\npublic class HtmlCleanerTest {\n private final HtmlCleaner cleaner = new HtmlCleaner();\n\n @Test\n public void testCleanUrl() {\n assertEquals(\"http:\/\/hallo.com\/test\", cleaner.getUrl(\"http:\/\/hallo.com\/test\"));\n assertEquals(\"http:\/\/hallo.com\/test2\", cleaner.getUrl(\"Hallo<\/a>\"));\n assertEquals(\"http:\/\/hallo.com\/test3?testparam=1\", cleaner.getUrl(\"Hallo2<\/a>\"));\n assertEquals(\"http:\/\/hallo.com\/test3?testparam=1¶m2=3\", cleaner.getUrl(\"Hallo3<\/a>\"));\n\n assertEquals(\"http:\/\/hallo.com\/test2123\", cleaner.getUrl(\"Hallo<\/a>123\"));\n\n assertNull(cleaner.getUrl(null));\n }\n}\n","subject":"Add test to ensure extra content after <\/a> is also extracted"} {"old_contents":"package org.mifos.framework.components.configuration;\n\nimport junit.framework.Test;\nimport junit.framework.TestSuite;\n\nimport org.mifos.application.master.business.TestMifosCurrency;\nimport org.mifos.framework.components.configuration.business.TestConfiguration;\nimport org.mifos.framework.components.configuration.persistence.TestConfigurationPersistence;\nimport org.mifos.framework.components.configuration.persistence.service.TestConfigurationPersistenceService;\nimport org.mifos.framework.components.configuration.util.helpers.TestConfigurationIntializer;\nimport org.mifos.framework.components.configuration.util.helpers.TestSystemConfig;\n\npublic class ConfigurationTestSuite extends TestSuite {\n\n\tpublic ConfigurationTestSuite() {\n\t\tsuper();\n\t}\n\n\tpublic static Test suite()throws Exception\n\t{\n\t\tTestSuite testSuite = new ConfigurationTestSuite();\n\t\ttestSuite.addTestSuite(TestConfigurationPersistence.class);\n\t\ttestSuite.addTestSuite(TestConfigurationPersistenceService.class);\n\t\ttestSuite.addTestSuite(TestSystemConfig.class);\n\t\ttestSuite.addTestSuite(TestMifosCurrency.class);\n\t\ttestSuite.addTestSuite(TestConfigurationIntializer.class);\n\t\ttestSuite.addTestSuite(TestConfiguration.class);\n\/\/\t\ttestSuite.addTestSuite(TestKey.class);\n\t\treturn testSuite;\n\t\t\n\t}\n}\n","new_contents":"package org.mifos.framework.components.configuration;\n\nimport junit.framework.Test;\nimport junit.framework.TestSuite;\n\nimport org.mifos.application.master.business.TestMifosCurrency;\nimport org.mifos.framework.components.configuration.business.TestConfiguration;\nimport org.mifos.framework.components.configuration.cache.TestKey;\nimport org.mifos.framework.components.configuration.persistence.TestConfigurationPersistence;\nimport org.mifos.framework.components.configuration.persistence.service.TestConfigurationPersistenceService;\nimport org.mifos.framework.components.configuration.util.helpers.TestConfigurationIntializer;\nimport org.mifos.framework.components.configuration.util.helpers.TestSystemConfig;\n\npublic class ConfigurationTestSuite extends TestSuite {\n\n\tpublic ConfigurationTestSuite() {\n\t\tsuper();\n\t}\n\n\tpublic static Test suite()throws Exception\n\t{\n\t\tTestSuite testSuite = new ConfigurationTestSuite();\n\t\ttestSuite.addTestSuite(TestConfigurationPersistence.class);\n\t\ttestSuite.addTestSuite(TestConfigurationPersistenceService.class);\n\t\ttestSuite.addTestSuite(TestSystemConfig.class);\n\t\ttestSuite.addTestSuite(TestMifosCurrency.class);\n\t\ttestSuite.addTestSuite(TestConfigurationIntializer.class);\n\t\ttestSuite.addTestSuite(TestConfiguration.class);\n\t\ttestSuite.addTestSuite(TestKey.class);\n\t\treturn testSuite;\n\t\t\n\t}\n}\n","subject":"Revert 11533 now that TestKey is checked in."} {"old_contents":"package com.atlassian.maven.plugins.amps;\n\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugin.MojoFailureException;\nimport org.jfrog.maven.annomojo.annotations.MojoGoal;\n\n@MojoGoal(\"compress-resources\")\npublic class CompressResourcesMojo extends AbstractAmpsMojo\n{\n public void execute() throws MojoExecutionException, MojoFailureException\n {\n getMavenGoals().compressResources();\n }\n}\n","new_contents":"package com.atlassian.maven.plugins.amps;\n\nimport org.apache.maven.plugin.MojoExecutionException;\nimport org.apache.maven.plugin.MojoFailureException;\nimport org.jfrog.maven.annomojo.annotations.MojoGoal;\nimport org.jfrog.maven.annomojo.annotations.MojoParameter;\n\n\/**\n * Compresses JavaScript resources with the YUI compressor Maven plugin. Creates compressed versions of all\n * JavaScript resources by attaching the '-min' suffix.\n *\n * @since 3.2\n *\/\n@MojoGoal(\"compress-resources\")\npublic class CompressResourcesMojo extends AbstractAmpsMojo\n{\n \/**\n * Whether to compress the resources or not. Defaults to true.\n *\/\n @MojoParameter(defaultValue = \"true\")\n private boolean compressResources;\n\n public void execute() throws MojoExecutionException, MojoFailureException\n {\n if (compressResources)\n {\n getMavenGoals().compressResources();\n }\n else\n {\n getLog().debug(\"Compressing resources disabled\");\n }\n }\n}\n","subject":"Allow resource compression to be disabled"} {"old_contents":"package net.wizardsoflua.annotation;\n\nimport static java.lang.annotation.ElementType.TYPE;\nimport static java.lang.annotation.RetentionPolicy.SOURCE;\n\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.Target;\n\n@Retention(SOURCE)\n@Target(TYPE)\npublic @interface GenerateLuaDoc {\n \/**\n * The name of the module. Required unless @{@link LuaClassAttributes} is present, in which case\n * the name defaults to {@link LuaClassAttributes#name()}.\n *\/\n String name() default \"\";\n\n \/**\n * The subtitle of the module.\n *\/\n String subtitle() default \"\";\n\n \/**\n * The document type ({@code \"module\"}, {@code \"class\"} or {@code \"event\"}). Defaults to\n * {@code \"class\"} when the type is also annotated with @{@link GenerateLuaClassTable}. Defaults\n * to {@code \"module\"} when the type is also annotated with @{@link GenerateLuaModuleTable}.\n *\/\n String type() default \"\";\n}\n","new_contents":"package net.wizardsoflua.annotation;\n\nimport static java.lang.annotation.ElementType.TYPE;\n\nimport java.lang.annotation.Target;\n\n\/**\n * We use class retention, because otherwise this annotation is not available on unchanged classes\n * during eclipses incremental compilation.\n * \n * @author Adrodoc\n *\/\n@Target(TYPE)\npublic @interface GenerateLuaDoc {\n \/**\n * The name of the module. Required unless @{@link LuaClassAttributes} is present, in which case\n * the name defaults to {@link LuaClassAttributes#name()}.\n *\/\n String name() default \"\";\n\n \/**\n * The subtitle of the module.\n *\/\n String subtitle() default \"\";\n\n \/**\n * The document type ({@code \"module\"}, {@code \"class\"} or {@code \"event\"}). Defaults to\n * {@code \"class\"} when the type is also annotated with @{@link GenerateLuaClassTable}. Defaults\n * to {@code \"module\"} when the type is also annotated with @{@link GenerateLuaModuleTable}.\n *\/\n String type() default \"\";\n}\n","subject":"Fix incremental compilation for lua classes that require a superclass name resolution"} {"old_contents":"package ip.cl.clipapp;\r\n\r\nimport java.net.URI;\r\nimport java.net.URISyntaxException;\r\n\r\nimport javax.sql.DataSource;\r\n\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\nimport org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;\r\nimport org.springframework.context.annotation.Bean;\r\nimport org.springframework.context.annotation.ComponentScan;\r\nimport org.springframework.context.annotation.Profile;\r\n\r\n@ComponentScan\r\n@SpringBootApplication\r\npublic class Application {\r\n\r\n public static void main(String[] args) {\r\n SpringApplication.run(Application.class, args);\r\n }\r\n\r\n @Profile(ClipAppProfile.HEROKU)\r\n @Bean\r\n public DataSource dataSource() throws URISyntaxException {\r\n URI dbUri = new URI(System.getenv(\"DATABASE_URL\"));\r\n\r\n String username = dbUri.getUserInfo().split(\":\")[0];\r\n String password = dbUri.getUserInfo().split(\":\")[1];\r\n String dbUrl = \"jdbc:postgresql:\/\/\" + dbUri.getHost() + ':' + dbUri.getPort() + dbUri.getPath();\r\n\r\n return DataSourceBuilder.create()\r\n .driverClassName(\"org.postgresql.Driver\")\r\n .username(username)\r\n .password(password)\r\n .url(dbUrl)\r\n .build();\r\n }\r\n\r\n}\r\n","new_contents":"package ip.cl.clipapp;\r\n\r\nimport java.net.URI;\r\nimport java.net.URISyntaxException;\r\n\r\nimport javax.sql.DataSource;\r\n\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.EnableAutoConfiguration;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\nimport org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;\r\nimport org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration;\r\nimport org.springframework.context.annotation.Bean;\r\nimport org.springframework.context.annotation.ComponentScan;\r\nimport org.springframework.context.annotation.Profile;\r\n\r\n@ComponentScan\r\n@EnableAutoConfiguration(exclude = { ErrorMvcAutoConfiguration.class })\r\n@SpringBootApplication\r\npublic class Application {\r\n\r\n public static void main(String[] args) {\r\n SpringApplication.run(Application.class, args);\r\n }\r\n\r\n @Profile(ClipAppProfile.HEROKU)\r\n @Bean\r\n public DataSource dataSource() throws URISyntaxException {\r\n URI dbUri = new URI(System.getenv(\"DATABASE_URL\"));\r\n\r\n String username = dbUri.getUserInfo().split(\":\")[0];\r\n String password = dbUri.getUserInfo().split(\":\")[1];\r\n String dbUrl = \"jdbc:postgresql:\/\/\" + dbUri.getHost() + ':' + dbUri.getPort() + dbUri.getPath();\r\n\r\n return DataSourceBuilder.create()\r\n .driverClassName(\"org.postgresql.Driver\")\r\n .username(username)\r\n .password(password)\r\n .url(dbUrl)\r\n .build();\r\n }\r\n\r\n}\r\n","subject":"Remove default while label error page"} {"old_contents":"package br.holandajunior.workday.repositories;\n\nimport br.holandajunior.workday.models.User;\nimport org.springframework.data.jpa.repository.JpaRepository;\n\n\/**\n * Created by holandajunior on 29\/04\/17.\n *\/\npublic interface IUserRepository extends JpaRepository< User, Long > {}\n","new_contents":"package br.holandajunior.workday.repositories;\n\nimport br.holandajunior.workday.models.repository.User;\nimport org.springframework.data.jpa.repository.JpaRepository;\n\n\/**\n * Created by holandajunior on 29\/04\/17.\n *\/\npublic interface IUserRepository extends JpaRepository< User, Long > {\n\n User findByUsername( String username );\n}\n","subject":"Add into repository to find user by username"} {"old_contents":"package com.amd.aparapi.test.runtime;\r\n\r\nimport static org.junit.Assert.assertTrue;\r\nimport org.junit.Test;\r\nimport com.amd.aparapi.Kernel;\r\n\r\nclass AnotherClass{\r\n static public int foo(int i) {\r\n return i + 42;\r\n }\r\n};\r\n\r\npublic class CallStaticFromAnonymousKernel {\r\n\r\n static final int size = 256;\r\n\r\n final int[] values = new int[size];\r\n final int[] results = new int[size];\r\n \r\n public CallStaticFromAnonymousKernel() {\r\n for(int i=0; i columns = new Vector<>();\n\t\tcolumns.add(\"Item ID\");\n\t\tcolumns.add(\"Item Name\");\n\t\tcolumns.add(\"Product\");\n\t\tcolumns.add(\"Brand\");\n\t\tcolumns.add(\"Price\");\n\t\tmodel.setTableColumnNames(columns);\n\t\tmodel.setItems(itemService.findAll());\n\t}\n\n}\n","new_contents":"package devopsdistilled.operp.client.items;\n\nimport javax.inject.Inject;\n\nimport devopsdistilled.operp.server.data.service.items.ItemService;\n\npublic class ListItemPaneControllerImpl implements ListItemPaneController {\n\n\t@Inject\n\tprivate ListItemModel model;\n\n\t@Inject\n\tprivate ItemService itemService;\n\n\t@Override\n\tpublic ListItemModel getModel() {\n\t\treturn model;\n\t}\n\n\t@Override\n\tpublic void loadData() {\n\t\tmodel.setItems(itemService.findAll());\n\t}\n\n}\n","subject":"Remove columnNames loading from loadData()"} {"old_contents":"package org.intermine.metadata;\n\n\/*\n * Copyright (C) 2002-2004 FlyMine\n *\n * This code may be freely distributed and modified under the\n * terms of the GNU Lesser General Public Licence. This should\n * be distributed with the code. See the LICENSE file for more\n * information or http:\/\/www.gnu.org\/copyleft\/lesser.html.\n *\n *\/\n\nimport junit.framework.TestCase;\n\nimport java.util.List;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.ArrayList;\n\nimport servletunit.struts.MockStrutsTestCase;\n\nimport org.intermine.metadata.Model;\nimport org.intermine.metadata.ClassDescriptor;\nimport org.intermine.model.testmodel.*;\n\n\/**\n * Tests for PrimaryKeyUtil.\n *\n * @author Kim Rutherford\n *\/\n\npublic class PrimaryKeyUtilTest extends TestCase\n{\n public PrimaryKeyUtilTest(String arg) {\n super(arg);\n }\n\n public void testGetPrimaryKeyFields() throws Exception {\n Model model = Model.getInstanceByName(\"testmodel\");\n Class c = Class.forName(\"org.intermine.model.testmodel.Employee\");\n List fields = PrimaryKeyUtil.getPrimaryKeyFields(model, c);\n ArrayList testFieldNames = new ArrayList();\n testFieldNames.add(\"name\");\n testFieldNames.add(\"id\");\n assertEquals(testFieldNames, fields);\n }\n}\n","new_contents":"package org.intermine.metadata;\n\n\/*\n * Copyright (C) 2002-2004 FlyMine\n *\n * This code may be freely distributed and modified under the\n * terms of the GNU Lesser General Public Licence. This should\n * be distributed with the code. See the LICENSE file for more\n * information or http:\/\/www.gnu.org\/copyleft\/lesser.html.\n *\n *\/\n\nimport junit.framework.TestCase;\n\nimport java.util.List;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.ArrayList;\n\nimport servletunit.struts.MockStrutsTestCase;\n\nimport org.intermine.metadata.Model;\nimport org.intermine.metadata.ClassDescriptor;\nimport org.intermine.model.testmodel.*;\n\n\/**\n * Tests for PrimaryKeyUtil.\n *\n * @author Kim Rutherford\n *\/\n\npublic class PrimaryKeyUtilTest extends TestCase\n{\n public PrimaryKeyUtilTest(String arg) {\n super(arg);\n }\n\n public void testGetPrimaryKeyFields() throws Exception {\n Model model = Model.getInstanceByName(\"testmodel\");\n Class c = Class.forName(\"org.intermine.model.testmodel.Employee\");\n List fields = PrimaryKeyUtil.getPrimaryKeyFields(model, c);\n ArrayList testFieldNames = new ArrayList();\n testFieldNames.add(\"id\");\n testFieldNames.add(\"name\");\n assertEquals(testFieldNames, fields);\n }\n}\n","subject":"Fix for test failure - the order of the List returned by getPrimaryKeyFields() has changed."} {"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.apache.jmeter.functions;\n\nimport org.apache.jmeter.util.JMeterUtils;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\n\n\/** Test JavaScript function with Rhino engine *\/\npublic class TestJavascriptFunctionWithRhino extends TestJavascriptFunction {\n\n @BeforeEach\n public void setUp() {\n JMeterUtils.getJMeterProperties().put(\"javascript.use_rhino\", \"true\");\n super.setUp();\n }\n\n @AfterEach\n public void tearDown() {\n JMeterUtils.getJMeterProperties().remove(\"javascript.use_rhino\");\n }\n}\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.apache.jmeter.functions;\n\nimport org.apache.jmeter.util.JMeterUtils;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\n\n\/** Test JavaScript function with Rhino engine *\/\npublic class TestJavascriptFunctionWithRhino extends TestJavascriptFunction {\n\n @BeforeEach\n @Override\n public void setUp() {\n JMeterUtils.getJMeterProperties().put(\"javascript.use_rhino\", \"true\");\n super.setUp();\n }\n\n @AfterEach\n @Override\n public void tearDown() {\n JMeterUtils.getJMeterProperties().remove(\"javascript.use_rhino\");\n }\n}\n","subject":"Add override annotations to make error prone happy"} {"old_contents":"package com.example.android.androidsimulator.activities;\n\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\n\nimport com.example.android.androidsimulator.R;\n\npublic class SelectedMessageContact extends AppCompatActivity {\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_selected_message_contact);\n }\n}\n","new_contents":"package com.example.android.androidsimulator.activities;\n\nimport android.content.SharedPreferences;\nimport android.preference.PreferenceManager;\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\nimport android.text.Editable;\nimport android.text.TextWatcher;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.Toast;\n\nimport com.example.android.androidsimulator.R;\nimport com.example.android.androidsimulator.data.Messages;\n\nimport java.util.ArrayList;\n\npublic class SelectedMessageContact extends AppCompatActivity {\n\n SharedPreferences preferences;\n SharedPreferences.Editor editor;\n ArrayList messages;\n Button sendMessageButton;\n EditText contentMessage;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_selected_message_contact);\n\n contentMessage = (EditText) findViewById(R.id.message_editText);\n sendMessageButton = (Button) findViewById(R.id.sendMessage_button);\n sendMessageButton.setEnabled(false);\n\n \/\/ setEvents\n setEvents();\n\n\n }\n\n private void setEvents() {\n \/\/ enable button of sendMessage\n contentMessage.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n if (contentMessage.length() > 0) {\n sendMessageButton.setEnabled(true);\n }\n else {\n sendMessageButton.setEnabled(false);\n }\n }\n\n @Override\n public void afterTextChanged(Editable editable) {\n\n }\n });\n\n \/\/ button send message\n sendMessageButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n sendMessage();\n }\n });\n }\n\n private void sendMessage() {\n \n }\n}\n\n","subject":"Add method of sendMessageButton - Enabled\/Disabled"} {"old_contents":"package trang;\n\nimport org.gradle.api.Plugin;\nimport org.gradle.api.Project;\nimport org.gradle.api.Task;\n\n\/**\n * Used for converting .rnc files to .xsd files.\n * @author Rob Winch\n *\/\npublic class TrangPlugin implements Plugin {\n\t@Override\n\tpublic void apply(Project project) {\n\t\tTask rncToXsd = project.getTasks().create(\"rncToXsd\", RncToXsd.class);\n\t\trncToXsd.setDescription(\"Converts .rnc to .xsd\");\n\t\trncToXsd.setGroup(\"Build\");\n\t}\n}\n","new_contents":"package trang;\n\nimport org.gradle.api.Plugin;\nimport org.gradle.api.Project;\n\n\/**\n * Used for converting .rnc files to .xsd files.\n * @author Rob Winch\n *\/\npublic class TrangPlugin implements Plugin {\n\t@Override\n\tpublic void apply(Project project) {\n\t\tproject.getTasks().register(\"rncToXsd\", RncToXsd.class, rncToXsd -> {\n\t\t\trncToXsd.setDescription(\"Converts .rnc to .xsd\");\n\t\t\trncToXsd.setGroup(\"Build\");\n\t\t});\n\t}\n}\n","subject":"Create the rncToXsd Task lazily"} {"old_contents":"\/*\n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage edu.stuy.subsystems;\n\nimport edu.stuy.RobotMap;\nimport edu.wpi.first.wpilibj.Servo;\nimport edu.wpi.first.wpilibj.command.Subsystem;\n\n\/**\n *\n * @author Yulli\n *\/\npublic class Camera extends Subsystem {\n \/\/ Put methods for controlling this subsystem\n \/\/ here. Call these from Commands.\n private static final int LOWER_ANGLE = 105;\n private static final int UPPER_ANGLE = 180;\n\n Servo camServo;\n \n public Camera(){\n camServo = new Servo(RobotMap.CAMERA_SERVO);\n \n }\n public void initDefaultCommand() {\n \/\/ Set the default command for a subsystem here.\n \/\/setDefaultCommand(new MySpecialCommand());\n }\n \n public void switchView(boolean down){\n if(down){\n camServo.setAngle(LOWER_ANGLE);\n }\n else {\n camServo.setAngle(UPPER_ANGLE);\n }\n }\n \n}\n","new_contents":"\/*\n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage edu.stuy.subsystems;\n\nimport edu.stuy.RobotMap;\nimport edu.wpi.first.wpilibj.Servo;\nimport edu.wpi.first.wpilibj.command.Subsystem;\n\n\/**\n *\n * @author Yulli\n *\/\npublic class Camera extends Subsystem {\n \/\/ Put methods for controlling this subsystem\n \/\/ here. Call these from Commands.\n private static final int LOWER_ANGLE = 115;\n private static final int UPPER_ANGLE = 180;\n\n Servo camServo;\n \n public Camera(){\n camServo = new Servo(RobotMap.CAMERA_SERVO);\n \n }\n public void initDefaultCommand() {\n \/\/ Set the default command for a subsystem here.\n \/\/setDefaultCommand(new MySpecialCommand());\n }\n \n public void switchView(boolean down){\n if(down){\n camServo.setAngle(LOWER_ANGLE);\n }\n else {\n camServo.setAngle(UPPER_ANGLE);\n }\n }\n \n}\n","subject":"Modify camera angle from 105 to 115 degrees."} {"old_contents":"package com.rackspacecloud.blueflood.service;\n\nimport com.rackspacecloud.blueflood.utils.Util;\nimport org.junit.Assert;\nimport org.junit.Ignore;\nimport org.junit.Test;\n\nimport java.util.Collection;\nimport java.util.Collections;\n\npublic class RollupServiceTest {\n\n @Test\n public void testRollupServiceWithDefaultConfigs() {\n\n Configuration config = Configuration.getInstance();\n final Collection shards = Collections.unmodifiableCollection(\n Util.parseShards(config.getStringProperty(CoreConfig.SHARDS)));\n final String zkCluster = config.getStringProperty(CoreConfig.ZOOKEEPER_CLUSTER);\n final ScheduleContext rollupContext = \"NONE\".equals(zkCluster) ?\n new ScheduleContext(System.currentTimeMillis(), shards) :\n new ScheduleContext(System.currentTimeMillis(), shards, zkCluster);\n\n RollupService service = new RollupService(rollupContext);\n\n Assert.assertNotNull(service);\n\n service.run(null, 120000L); \/\/ default SCHEDULE_POLL_PERIOD is 60 seconds\n\n Assert.assertTrue(true);\n }\n}\n","new_contents":"package com.rackspacecloud.blueflood.service;\n\nimport com.rackspacecloud.blueflood.utils.Util;\nimport org.junit.*;\n\nimport java.io.IOException;\nimport java.util.Collection;\nimport java.util.Collections;\n\npublic class RollupServiceTest {\n\n @Before\n public void setup() throws IOException {\n Configuration.getInstance().init();\n }\n\n @After\n public void tearDown() throws IOException {\n Configuration.getInstance().init();\n }\n\n @Test\n public void testRollupServiceWithDefaultConfigs() {\n\n Configuration config = Configuration.getInstance();\n final Collection shards = Collections.unmodifiableCollection(\n Util.parseShards(config.getStringProperty(CoreConfig.SHARDS)));\n final String zkCluster = config.getStringProperty(CoreConfig.ZOOKEEPER_CLUSTER);\n final ScheduleContext rollupContext = \"NONE\".equals(zkCluster) ?\n new ScheduleContext(System.currentTimeMillis(), shards) :\n new ScheduleContext(System.currentTimeMillis(), shards, zkCluster);\n\n RollupService service = new RollupService(rollupContext);\n\n Assert.assertNotNull(service);\n\n service.run(null, 120000L); \/\/ default SCHEDULE_POLL_PERIOD is 60 seconds\n\n Assert.assertTrue(true);\n }\n}\n","subject":"Clean up the configuration before and after the test."} {"old_contents":"package imagej.data.autoscale;\n\nimport static org.junit.Assert.assertTrue;\nimport net.imglib2.img.Img;\nimport net.imglib2.img.array.ArrayImgs;\nimport net.imglib2.ops.util.Tuple2;\nimport net.imglib2.type.numeric.RealType;\nimport net.imglib2.type.numeric.integer.ByteType;\n\nimport org.junit.Test;\nimport org.scijava.Context;\n\n\npublic class ConfidenceIntervalAutoscaleMethodTest {\n\n\tContext context = new Context(AutoscaleService.class);\n\n\t@Test\n\tpublic void test() {\n\t\tAutoscaleService service = context.getService(AutoscaleService.class);\n\t\tAutoscaleMethod method = service.getAutoscaleMethod(\"95% CI\");\n\t\tImg img = getImg();\n\t\tTuple2 range = method.getRange(img);\n\t\tSystem.out.println(range.get1());\n\t\tSystem.out.println(range.get2());\n\t\tassertTrue(true);\n\t}\n\n\tprivate Img getImg() {\n\t\tImg img = ArrayImgs.bytes(100);\n\t\tbyte i = 0;\n\t\tfor (ByteType b : img)\n\t\t\tb.set(i++);\n\t\treturn (Img) (Img) img;\n\t}\n}\n","new_contents":"package imagej.data.autoscale;\n\nimport static org.junit.Assert.assertEquals;\nimport net.imglib2.img.Img;\nimport net.imglib2.img.array.ArrayImgs;\nimport net.imglib2.ops.util.Tuple2;\nimport net.imglib2.type.numeric.RealType;\nimport net.imglib2.type.numeric.integer.ByteType;\n\nimport org.junit.Test;\nimport org.scijava.Context;\n\n\npublic class ConfidenceIntervalAutoscaleMethodTest {\n\n\tContext context = new Context(AutoscaleService.class);\n\n\t@Test\n\tpublic void test() {\n\t\tAutoscaleService service = context.getService(AutoscaleService.class);\n\t\tAutoscaleMethod method = service.getAutoscaleMethod(\"95% CI\");\n\t\tImg img = getImg();\n\t\tTuple2 range = method.getRange(img);\n\t\t\/\/ System.out.println(range.get1());\n\t\t\/\/ System.out.println(range.get2());\n\t\tassertEquals(2, range.get1(), 0);\n\t\tassertEquals(97, range.get2(), 0);\n\t}\n\n\tprivate Img getImg() {\n\t\tImg img = ArrayImgs.bytes(100);\n\t\tbyte i = 0;\n\t\tfor (ByteType b : img)\n\t\t\tb.set(i++);\n\t\treturn (Img) (Img) img;\n\t}\n}\n","subject":"Improve confidence interval test code"} {"old_contents":"package org.bouncycastle.cms;\n\nimport java.security.AlgorithmParameters;\nimport java.security.InvalidAlgorithmParameterException;\nimport java.security.spec.InvalidParameterSpecException;\n\nimport javax.crypto.interfaces.PBEKey;\nimport javax.crypto.spec.PBEParameterSpec;\n\npublic abstract class CMSPBEKey\n implements PBEKey\n{\n private char[] password;\n private byte[] salt;\n private int iterationCount;\n\n protected static PBEParameterSpec getParamSpec(AlgorithmParameters algParams)\n throws InvalidAlgorithmParameterException\n {\n try\n {\n return algParams.getParameterSpec(PBEParameterSpec.class);\n }\n catch (InvalidParameterSpecException e)\n {\n throw new InvalidAlgorithmParameterException(\"cannot process PBE spec: \" + e.getMessage());\n }\n }\n\n public CMSPBEKey(char[] password, byte[] salt, int iterationCount)\n {\n this.password = password;\n this.salt = salt;\n this.iterationCount = iterationCount;\n }\n\n public CMSPBEKey(char[] password, PBEParameterSpec pbeSpec)\n {\n this(password, pbeSpec.getSalt(), pbeSpec.getIterationCount());\n }\n \n public char[] getPassword()\n {\n return password;\n }\n\n public byte[] getSalt()\n {\n return salt;\n }\n\n public int getIterationCount()\n {\n return iterationCount;\n }\n\n public String getAlgorithm()\n {\n return \"PKCS5S2\";\n }\n\n public String getFormat()\n {\n return \"RAW\";\n }\n\n public byte[] getEncoded()\n {\n return null;\n }\n\n abstract byte[] getEncoded(String algorithmOid);\n}\n","new_contents":"package org.bouncycastle.cms;\n\nimport java.security.AlgorithmParameters;\nimport java.security.InvalidAlgorithmParameterException;\nimport java.security.spec.InvalidParameterSpecException;\n\nimport javax.crypto.interfaces.PBEKey;\nimport javax.crypto.spec.PBEParameterSpec;\n\npublic abstract class CMSPBEKey\n implements PBEKey\n{\n private char[] password;\n private byte[] salt;\n private int iterationCount;\n\n protected static PBEParameterSpec getParamSpec(AlgorithmParameters algParams)\n throws InvalidAlgorithmParameterException\n {\n try\n {\n return (PBEParameterSpec)algParams.getParameterSpec(PBEParameterSpec.class);\n }\n catch (InvalidParameterSpecException e)\n {\n throw new InvalidAlgorithmParameterException(\"cannot process PBE spec: \" + e.getMessage());\n }\n }\n\n public CMSPBEKey(char[] password, byte[] salt, int iterationCount)\n {\n this.password = password;\n this.salt = salt;\n this.iterationCount = iterationCount;\n }\n\n public CMSPBEKey(char[] password, PBEParameterSpec pbeSpec)\n {\n this(password, pbeSpec.getSalt(), pbeSpec.getIterationCount());\n }\n \n public char[] getPassword()\n {\n return password;\n }\n\n public byte[] getSalt()\n {\n return salt;\n }\n\n public int getIterationCount()\n {\n return iterationCount;\n }\n\n public String getAlgorithm()\n {\n return \"PKCS5S2\";\n }\n\n public String getFormat()\n {\n return \"RAW\";\n }\n\n public byte[] getEncoded()\n {\n return null;\n }\n\n abstract byte[] getEncoded(String algorithmOid);\n}\n","subject":"Add cast so code compiles properly under source 1.4"} {"old_contents":"package org.testcontainers.dockerclient;\n\nimport com.github.dockerjava.api.DockerClient;\nimport com.github.dockerjava.core.DockerClientBuilder;\nimport com.github.dockerjava.core.DockerClientConfig;\n\npublic class UnixSocketConfigurationStrategy implements DockerConfigurationStrategy {\n\n @Override\n public DockerClientConfig provideConfiguration()\n throws InvalidConfigurationException {\n DockerClientConfig config = new DockerClientConfig.DockerClientConfigBuilder().withUri(\"unix:\/\/\/var\/run\/docker.sock\").build();\n DockerClient client = DockerClientBuilder.getInstance(config).build();\n\n try {\n client.pingCmd().exec();\n } catch (Exception e) {\n throw new InvalidConfigurationException(\"ping failed\");\n }\n\n LOGGER.info(\"Access docker with unix local socker\");\n return config;\n }\n\n @Override\n public String getDescription() {\n return \"unix socket docker access\";\n }\n\n}\n","new_contents":"package org.testcontainers.dockerclient;\n\nimport com.github.dockerjava.api.DockerClient;\nimport com.github.dockerjava.core.DockerClientBuilder;\nimport com.github.dockerjava.core.DockerClientConfig;\n\npublic class UnixSocketConfigurationStrategy implements DockerConfigurationStrategy {\n\n public static final String SOCKET_LOCATION = \"unix:\/\/\/var\/run\/docker.sock\";\n\n @Override\n public DockerClientConfig provideConfiguration()\n throws InvalidConfigurationException {\n DockerClientConfig config = new DockerClientConfig.DockerClientConfigBuilder().withUri(SOCKET_LOCATION).build();\n DockerClient client = DockerClientBuilder.getInstance(config).build();\n\n try {\n client.pingCmd().exec();\n } catch (Exception e) {\n throw new InvalidConfigurationException(\"ping failed\");\n }\n\n LOGGER.info(\"Accessing docker with local Unix socket\");\n return config;\n }\n\n @Override\n public String getDescription() {\n return \"local Unix socket (\" + SOCKET_LOCATION + \")\";\n }\n\n}\n","subject":"Update log wording for Unix socket config strategy"} {"old_contents":"\/\/ Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\n package com.yahoo.vespa.config.server.maintenance;\n\nimport com.yahoo.path.Path;\nimport com.yahoo.vespa.config.server.ApplicationRepository;\nimport com.yahoo.vespa.curator.Curator;\n\nimport java.time.Duration;\n\n\/**\n * Removes unused zookeeper data (for now only data used by old file distribution code is removed)\n *\/\npublic class ZooKeeperDataMaintainer extends Maintainer {\n\n ZooKeeperDataMaintainer(ApplicationRepository applicationRepository, Curator curator, Duration interval) {\n super(applicationRepository, curator, interval);\n }\n\n @Override\n protected void maintain() {\n curator.delete(Path.fromString(\"\/vespa\/filedistribution\"));\n curator.delete(Path.fromString(\"\/vespa\/config\"));\n }\n}\n","new_contents":"\/\/ Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\n package com.yahoo.vespa.config.server.maintenance;\n\nimport com.yahoo.path.Path;\nimport com.yahoo.vespa.config.server.ApplicationRepository;\nimport com.yahoo.vespa.curator.Curator;\n\nimport java.time.Duration;\n\n\/**\n * Removes unused zookeeper data (for now only data used by old file distribution code is removed)\n *\/\npublic class ZooKeeperDataMaintainer extends Maintainer {\n\n ZooKeeperDataMaintainer(ApplicationRepository applicationRepository, Curator curator, Duration interval) {\n super(applicationRepository, curator, interval);\n }\n\n @Override\n protected void maintain() {\n curator.delete(Path.fromString(\"\/vespa\/filedistribution\"));\n curator.delete(Path.fromString(\"\/vespa\/config\"));\n curator.delete(Path.fromString(\"\/provision\/v1\/defaultFlavor\"));\n }\n}\n","subject":"Remove unused zk data for default flavor override"} {"old_contents":"package org.slc.sli.api.resources.config;\n\nimport javax.ws.rs.Produces;\nimport javax.ws.rs.ext.ContextResolver;\nimport javax.ws.rs.ext.Provider;\n\nimport org.codehaus.jackson.map.ObjectMapper;\nimport org.codehaus.jackson.map.SerializationConfig;\nimport org.springframework.stereotype.Component;\n\nimport org.slc.sli.api.resources.Resource;\n\n\/**\n * Provides a Jackson context resolver that Jersey uses for serializing to JSON.\n * \n * @author Sean Melody \n * \n *\/\n\n@Provider\n@Component\n@Produces({ Resource.JSON_MEDIA_TYPE, Resource.SLC_JSON_MEDIA_TYPE })\npublic class CustomJacksonContextResolver implements ContextResolver {\n \n private ObjectMapper mapper = new ObjectMapper();\n \n public CustomJacksonContextResolver() {\n mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);\n mapper.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);\n }\n \n @Override\n public ObjectMapper getContext(Class cl) {\n \n return mapper;\n \n }\n}\n","new_contents":"package org.slc.sli.api.resources.config;\n\nimport javax.ws.rs.Produces;\nimport javax.ws.rs.ext.ContextResolver;\nimport javax.ws.rs.ext.Provider;\n\nimport org.codehaus.jackson.map.ObjectMapper;\nimport org.codehaus.jackson.map.SerializationConfig;\nimport org.springframework.stereotype.Component;\n\nimport org.slc.sli.api.resources.Resource;\n\n\/**\n * Provides a Jackson context resolver that Jersey uses for serializing to JSON or XML.\n * \n * @author Sean Melody \n * \n *\/\n\n@Provider\n@Component\n@Produces({ Resource.JSON_MEDIA_TYPE, Resource.SLC_JSON_MEDIA_TYPE, Resource.XML_MEDIA_TYPE, Resource.SLC_XML_MEDIA_TYPE })\npublic class CustomJacksonContextResolver implements ContextResolver {\n \n private ObjectMapper mapper = new ObjectMapper();\n \n public CustomJacksonContextResolver() {\n mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);\n mapper.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);\n }\n \n @Override\n public ObjectMapper getContext(Class cl) {\n \n return mapper;\n \n }\n}\n","subject":"Add XML to @produces for ContextResolver"} {"old_contents":"package de.fu_berlin.cdv.chasingpictures.activity;\n\nimport android.content.Intent;\nimport android.test.ActivityInstrumentationTestCase2;\n\nimport java.util.List;\n\nimport de.fu_berlin.cdv.chasingpictures.DebugUtilities;\nimport de.fu_berlin.cdv.chasingpictures.api.Picture;\nimport de.fu_berlin.cdv.chasingpictures.api.Place;\n\n\/**\n * @author Simon Kalt\n *\/\npublic class SlideshowTest extends ActivityInstrumentationTestCase2 {\n\n public SlideshowTest() {\n super(Slideshow.class);\n }\n\n public void setUp() throws Exception {\n super.setUp();\n Place placeWithPictures = DebuggUtilities.getPlaceWithPictures();\n if (placeWithPictures != null) {\n List pictures = placeWithPictures.getPictures();\n\n \/\/ Set up activity intent\n Intent intent = Slideshow.createIntent(getInstrumentation().getContext(), pictures);\n setActivityIntent(intent);\n }\n }\n\n public void testIntentDataReceived() throws Exception {\n List pictures = getActivity().pictures;\n assertFalse(\"Received no pictures from Intent\", pictures == null || pictures.isEmpty());\n }\n}\n","new_contents":"package de.fu_berlin.cdv.chasingpictures.activity;\n\nimport android.content.Intent;\nimport android.test.ActivityInstrumentationTestCase2;\n\nimport java.util.List;\n\nimport de.fu_berlin.cdv.chasingpictures.DebugUtilities;\nimport de.fu_berlin.cdv.chasingpictures.api.Picture;\nimport de.fu_berlin.cdv.chasingpictures.api.Place;\n\n\/**\n * @author Simon Kalt\n *\/\npublic class SlideshowTest extends ActivityInstrumentationTestCase2 {\n\n public SlideshowTest() {\n super(Slideshow.class);\n }\n\n public void setUp() throws Exception {\n super.setUp();\n Place placeWithPictures = DebugUtilities.getPlaceWithPictures();\n if (placeWithPictures != null) {\n List pictures = placeWithPictures.getPictures();\n\n \/\/ Set up activity intent\n Intent intent = Slideshow.createIntent(getInstrumentation().getContext(), pictures);\n setActivityIntent(intent);\n }\n }\n\n public void testIntentDataReceived() throws Exception {\n List pictures = getActivity().pictures;\n assertFalse(\"Received no pictures from Intent\", pictures == null || pictures.isEmpty());\n }\n}\n","subject":"Fix typo in test class"} {"old_contents":"package com.hubspot.jinjava.lib.exptest;\n\nimport com.hubspot.jinjava.doc.annotations.JinjavaDoc;\nimport com.hubspot.jinjava.doc.annotations.JinjavaParam;\nimport com.hubspot.jinjava.doc.annotations.JinjavaSnippet;\nimport com.hubspot.jinjava.interpret.InterpretException;\nimport com.hubspot.jinjava.interpret.JinjavaInterpreter;\n\n\n@JinjavaDoc(value=\"Return true if variable is pointing at same object as other variable\",\n params=@JinjavaParam(value=\"other\", type=\"object\", desc=\"A second object to check the variables value against\"), \n snippets={\n @JinjavaSnippet(\n code=\"{% if var_one is sameas var_two %}\\n\" +\n \"\\n\" +\n \"{% endif %}\"),\n }\n )\npublic class IsSameAsExpTest implements ExpTest {\n\n @Override\n public String getName() {\n return \"sameas\";\n }\n\n @Override\n public boolean evaluate(Object var, JinjavaInterpreter interpreter,\n Object... args) {\n if(args.length == 0) {\n throw new InterpretException(getName() + \" test requires 1 argument\");\n }\n\n return var == args[0];\n }\n\n}\n","new_contents":"package com.hubspot.jinjava.lib.exptest;\n\nimport com.hubspot.jinjava.doc.annotations.JinjavaDoc;\nimport com.hubspot.jinjava.doc.annotations.JinjavaParam;\nimport com.hubspot.jinjava.doc.annotations.JinjavaSnippet;\nimport com.hubspot.jinjava.interpret.InterpretException;\nimport com.hubspot.jinjava.interpret.JinjavaInterpreter;\n\n\n@JinjavaDoc(value=\"Return true if variable is pointing at same object as other variable\",\n params=@JinjavaParam(value=\"other\", type=\"object\", desc=\"A second object to check the variables value against\"),\n snippets={\n @JinjavaSnippet(\n code=\"{% if var_one is sameas var_two %}\\n\" +\n \"\\n\" +\n \"{% endif %}\"),\n }\n )\npublic class IsSameAsExpTest implements ExpTest {\n\n @Override\n public String getName() {\n return \"sameas\";\n }\n\n @Override\n public boolean evaluate(Object var, JinjavaInterpreter interpreter,\n Object... args) {\n if(args.length == 0) {\n throw new InterpretException(getName() + \" test requires 1 argument\");\n }\n\n return var == args[0];\n }\n\n}\n","subject":"Convert more tabs to spaces to resolve errors"} {"old_contents":"package org.motechproject.tasks.osgi;\n\nimport org.eclipse.gemini.blueprint.service.exporter.OsgiServiceRegistrationListener;\nimport org.motechproject.tasks.service.ChannelService;\nimport org.osgi.framework.BundleContext;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\n\nimport java.util.Map;\n\n\/**\n * A listener for {@link ChannelService}, effectively serves as a tasks-bundle start handler, that sets up tracking of start\/stop events of all other bundles\n *\/\npublic class ChannelServiceRegistrationListener implements OsgiServiceRegistrationListener {\n\n private static final Logger LOG = LoggerFactory.getLogger(ChannelServiceRegistrationListener.class);\n\n private BundleContext bundleContext;\n private TasksBlueprintApplicationContextTracker tracker;\n\n @Autowired\n public ChannelServiceRegistrationListener(BundleContext bundleContext) {\n LOG.info(\"Starting ChannelService registration listener\");\n this.bundleContext = bundleContext;\n }\n\n @Override\n public void registered(Object service, Map serviceProperties) {\n if (service instanceof ChannelService && tracker == null) {\n LOG.info(\"ChannelService registered, starting TasksBlueprintApplicationContextTracker\");\n\n ChannelService channelService = (ChannelService) service;\n\n tracker = new TasksBlueprintApplicationContextTracker(bundleContext, channelService);\n tracker.open(true);\n }\n }\n\n @Override\n public void unregistered(Object service, Map serviceProperties) {\n if (service instanceof ChannelService && tracker != null) {\n tracker.close();\n }\n }\n}\n","new_contents":"package org.motechproject.tasks.osgi;\n\nimport org.eclipse.gemini.blueprint.service.exporter.OsgiServiceRegistrationListener;\nimport org.motechproject.tasks.service.ChannelService;\nimport org.osgi.framework.BundleContext;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\n\nimport java.util.Map;\n\n\/**\n * A listener for {@link ChannelService}, effectively serves as a tasks-bundle start handler, that sets up tracking of start\/stop events of all other bundles\n *\/\npublic class ChannelServiceRegistrationListener implements OsgiServiceRegistrationListener {\n\n private static final Logger LOG = LoggerFactory.getLogger(ChannelServiceRegistrationListener.class);\n\n private BundleContext bundleContext;\n private TasksBlueprintApplicationContextTracker tracker;\n\n @Autowired\n public ChannelServiceRegistrationListener(BundleContext bundleContext) {\n LOG.info(\"Starting ChannelService registration listener\");\n this.bundleContext = bundleContext;\n }\n\n @Override\n public void registered(Object service, Map serviceProperties) {\n if (service instanceof ChannelService && tracker == null) {\n LOG.info(\"ChannelService registered, starting TasksBlueprintApplicationContextTracker\");\n\n ChannelService channelService = (ChannelService) service;\n\n tracker = new TasksBlueprintApplicationContextTracker(bundleContext, channelService);\n tracker.open(true);\n }\n }\n\n @Override\n public void unregistered(Object service, Map serviceProperties) {\n if (service instanceof ChannelService && tracker != null) {\n tracker.close();\n tracker = null;\n }\n }\n}\n","subject":"Fix task channel registration when installing module from UI"} {"old_contents":"package se.kits.gakusei.controller;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.InjectMocks;\nimport org.mockito.Mock;\nimport org.mockito.Mockito;\nimport org.mockito.MockitoAnnotations;\nimport org.mockito.runners.MockitoJUnitRunner;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.http.ResponseEntity;\nimport se.kits.gakusei.content.model.Course;\nimport se.kits.gakusei.content.repository.CourseRepository;\nimport se.kits.gakusei.test_tools.TestTools;\n\nimport static org.junit.Assert.*;\n\n@RunWith(MockitoJUnitRunner.class)\npublic class CourseControllerTest {\n\n @InjectMocks\n private CourseController courseController;\n\n @Mock\n private CourseRepository courseRepository;\n\n private Course testCourse;\n\n @Before\n public void setUp(){\n MockitoAnnotations.initMocks(this);\n\n testCourse = TestTools.generateCourse();\n }\n\n @Test\n public void getAllCourses() throws Exception {\n }\n\n @Test\n public void getCourseByID() throws Exception {\n Mockito.when(courseRepository.findOne(testCourse.getId())).thenReturn(testCourse);\n\n ResponseEntity re = courseController.getCourseByID(testCourse.getId());\n\n assertEquals(HttpStatus.OK, re.getStatusCode());\n assertEquals(testCourse, re.getBody());\n }\n\n @Test\n public void getCourseByName() throws Exception {\n }\n\n @Test\n public void getCourseByCode() throws Exception {\n }\n\n}","new_contents":"package se.kits.gakusei.controller;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.InjectMocks;\nimport org.mockito.Mock;\nimport org.mockito.Mockito;\nimport org.mockito.MockitoAnnotations;\nimport org.mockito.runners.MockitoJUnitRunner;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.http.ResponseEntity;\nimport se.kits.gakusei.content.model.Course;\nimport se.kits.gakusei.content.repository.CourseRepository;\nimport se.kits.gakusei.test_tools.TestTools;\n\nimport static org.junit.Assert.*;\n\n@RunWith(MockitoJUnitRunner.class)\npublic class CourseControllerTest {\n\n @InjectMocks\n private CourseController courseController;\n\n @Mock\n private CourseRepository courseRepository;\n\n private Course testCourse;\n\n @Before\n public void setUp(){\n MockitoAnnotations.initMocks(this);\n\n testCourse = TestTools.generateCourse();\n }\n\n @Test\n public void testGetAllCoursesOK() throws Exception {\n }\n\n @Test\n public void testGetCourseByIDOK() throws Exception {\n Mockito.when(courseRepository.findOne(testCourse.getId())).thenReturn(testCourse);\n\n ResponseEntity re = courseController.getCourseByID(testCourse.getId());\n\n assertEquals(HttpStatus.OK, re.getStatusCode());\n assertEquals(testCourse, re.getBody());\n }\n\n @Test\n public void tetGetCourseByNameOK() throws Exception {\n }\n\n @Test\n public void tetsGetCourseByCodeOK() throws Exception {\n }\n\n}","subject":"Change test names to follow convention"} {"old_contents":"\/*\n * Copyright 2014 Open mHealth\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.openmhealth.data.generator.service;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport org.openmhealth.schema.pojos.DataPoint;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.beans.factory.annotation.Value;\nimport org.springframework.stereotype.Service;\n\nimport java.io.BufferedWriter;\nimport java.io.FileWriter;\nimport java.io.IOException;\n\n\n\/**\n * @author Emerson Farrugia\n *\/\n@Service\npublic class FileSystemDataPointWritingServiceImpl implements DataPointWritingService {\n\n @Value(\"${filename}\")\n private String filename;\n\n @Autowired\n private ObjectMapper objectMapper;\n\n @Override\n public void writeDataPoints(Iterable dataPoints) throws IOException {\n\n try (BufferedWriter writer = new BufferedWriter(new FileWriter(filename))) {\n\n for (DataPoint dataPoint : dataPoints) {\n objectMapper.writeValue(writer, dataPoint);\n }\n }\n }\n}\n","new_contents":"\/*\n * Copyright 2014 Open mHealth\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.openmhealth.data.generator.service;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport org.openmhealth.schema.pojos.DataPoint;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.beans.factory.annotation.Value;\nimport org.springframework.stereotype.Service;\n\nimport java.io.BufferedWriter;\nimport java.io.FileWriter;\nimport java.io.IOException;\n\n\n\/**\n * @author Emerson Farrugia\n *\/\n@Service\npublic class FileSystemDataPointWritingServiceImpl implements DataPointWritingService {\n\n @Value(\"${filename}\")\n private String filename;\n\n @Autowired\n private ObjectMapper objectMapper;\n\n @Override\n public void writeDataPoints(Iterable dataPoints) throws IOException {\n\n try (BufferedWriter writer = new BufferedWriter(new FileWriter(filename))) {\n\n for (DataPoint dataPoint : dataPoints) {\n String valueAsString = objectMapper.writeValueAsString(dataPoint);\n writer.write(valueAsString);\n writer.write(\"\\n\");\n }\n }\n }\n}\n","subject":"Add newline delimiters to filesystem writer and work around Jackson closing a writer it doesn't own."} {"old_contents":"package com.pilot51.voicenotify;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.preference.Preference;\nimport android.preference.Preference.OnPreferenceClickListener;\nimport android.preference.PreferenceActivity;\n\npublic class MainActivity extends PreferenceActivity {\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\taddPreferencesFromResource(R.xml.preferences);\n\n\t\t((Preference) findPreference(\"accessibility\")).setOnPreferenceClickListener(new OnPreferenceClickListener() {\n\t\t\tpublic boolean onPreferenceClick(Preference preference) {\n\t\t\t\tstartActivity(new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\t\t\n\t\t((Preference) findPreference(\"appList\")).setOnPreferenceClickListener(new OnPreferenceClickListener() {\n\t\t\tpublic boolean onPreferenceClick(Preference preference) {\n\t\t\t\tstartActivity(new Intent(MainActivity.this, AppList.class));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\t}\n}\n","new_contents":"package com.pilot51.voicenotify;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.preference.Preference;\nimport android.preference.PreferenceActivity;\n\npublic class MainActivity extends PreferenceActivity {\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\taddPreferencesFromResource(R.xml.preferences);\n\n\t\tPreference accessPref = (Preference)findPreference(\"accessibility\");\n\t\tint sdkVer = android.os.Build.VERSION.SDK_INT;\n\t\tif (sdkVer > 4) {\n\t\t\taccessPref.setIntent(new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS));\n\t\t} else if (sdkVer == 4) {\n\t\t\tIntent intent = new Intent(Intent.ACTION_MAIN);\n\t\t\tintent.setClassName(\"com.android.settings\", \"com.android.settings.AccessibilitySettings\");\n\t\t\taccessPref.setIntent(intent);\n\t\t}\n\t\t\n\t\t((Preference)findPreference(\"appList\")).setIntent(new Intent(this, AppList.class));\n\t}\n}\n","subject":"Fix crash in 1.6 at Accessibility settings intent."} {"old_contents":"package com.microsoft.applicationinsights.logging;\r\n\r\nimport android.util.Log;\r\n\r\nimport com.microsoft.applicationinsights.library.ApplicationInsights;\r\n\r\npublic class InternalLogging {\r\n private static final String PREFIX = InternalLogging.class.getPackage().getName();\r\n\r\n private InternalLogging() {\r\n \/\/ hide default constructor\r\n }\r\n\r\n \/**\r\n * Inform SDK users about SDK activities. This has 3 parameters to avoid the string\r\n * concatenation then verbose mode is disabled.\r\n *\r\n * @param tag the log context\r\n * @param message the log message\r\n * @param payload the payload for the message\r\n *\/\r\n public static void info(String tag, String message, String payload) {\r\n if (ApplicationInsights.isDeveloperMode()) {\r\n Log.i(PREFIX + tag, message + \":\" + payload);\r\n }\r\n }\r\n\r\n \/**\r\n * Warn SDK users about non-critical SDK misuse\r\n *\r\n * @param tag the log context\r\n * @param message the log message\r\n *\/\r\n public static void warn(String tag, String message) {\r\n if (ApplicationInsights.isDeveloperMode()) {\r\n Log.w(PREFIX + tag, message);\r\n }\r\n }\r\n\r\n \/**\r\n * Log critical SDK error\r\n *\r\n * @param tag the log context\r\n * @param message the log message\r\n *\/\r\n public static void error(String tag, String message) {\r\n Log.e(PREFIX + tag, message);\r\n }\r\n}\r\n\r\n","new_contents":"package com.microsoft.applicationinsights.logging;\r\n\r\nimport android.util.Log;\r\n\r\nimport com.microsoft.applicationinsights.library.ApplicationInsights;\r\n\r\npublic class InternalLogging {\r\n private static final String PREFIX = InternalLogging.class.getPackage().getName();\r\n\r\n private InternalLogging() {\r\n \/\/ hide default constructor\r\n }\r\n\r\n \/**\r\n * Inform SDK users about SDK activities. This has 3 parameters to avoid the string\r\n * concatenation then verbose mode is disabled.\r\n *\r\n * @param tag the log context\r\n * @param message the log message\r\n * @param payload the payload for the message\r\n *\/\r\n public static void info(String tag, String message, String payload) {\r\n if (ApplicationInsights.isDeveloperMode()) {\r\n Log.i(PREFIX + \" \" + tag, message + \":\" + payload);\r\n }\r\n }\r\n\r\n \/**\r\n * Warn SDK users about non-critical SDK misuse\r\n *\r\n * @param tag the log context\r\n * @param message the log message\r\n *\/\r\n public static void warn(String tag, String message) {\r\n if (ApplicationInsights.isDeveloperMode()) {\r\n Log.w(PREFIX + \" \" + tag, message);\r\n }\r\n }\r\n\r\n \/**\r\n * Log critical SDK error\r\n *\r\n * @param tag the log context\r\n * @param message the log message\r\n *\/\r\n public static void error(String tag, String message) {\r\n Log.e(PREFIX + \" \" + tag, message);\r\n }\r\n}\r\n\r\n","subject":"Add empty space to logging output"} {"old_contents":"package com.proxerme.library.enums;\n\nimport com.squareup.moshi.Json;\n\n\/**\n * TODO: Describe class\n *\n * @author Ruben Gees\n *\/\npublic enum MediaLanguage {\n @Json(name = \"de\")GERMAN,\n @Json(name = \"en\")ENGLISH\n}\n","new_contents":"package com.proxerme.library.enums;\n\nimport com.squareup.moshi.Json;\n\n\/**\n * TODO: Describe class\n *\n * @author Ruben Gees\n *\/\npublic enum MediaLanguage {\n @Json(name = \"de\")GERMAN,\n @Json(name = \"en\")ENGLISH,\n @Json(name = \"gersub\")GERMAN_SUB,\n @Json(name = \"gerdub\")GERMAN_DUB,\n @Json(name = \"engsub\")ENGLISH_SUB,\n @Json(name = \"engdub\")ENGLISH_DUB\n}\n","subject":"Add missing languages to the respective enum"} {"old_contents":"package com.autonomy.abc.selenium.find.filters;\r\n\r\nimport com.hp.autonomy.frontend.selenium.util.ElementUtil;\r\nimport org.openqa.selenium.By;\r\nimport org.openqa.selenium.WebDriver;\r\nimport org.openqa.selenium.WebElement;\r\n\r\nimport java.util.List;\r\n\r\nimport static com.sun.xml.internal.ws.spi.db.BindingContextFactory.LOGGER;\r\n\r\npublic class ParametricFilterNode extends FilterNode {\r\n\r\n ParametricFilterNode(WebElement element, WebDriver webDriver) {\r\n super(element, webDriver);\r\n }\r\n\r\n public List getChildren(){\r\n return getContainer().findElements(By.className(\"parametric-value-name\"));\r\n }\r\n\r\n @Override\r\n public List getChildNames() {\r\n return ElementUtil.getTexts(getChildren());\r\n }\r\n\r\n public List getChildDocCount(){\r\n return getContainer().findElements(By.className(\"parametric-value-count\"));\r\n }\r\n\r\n public List getFullChildrenElements(){\r\n return getContainer().findElements(By.className(\"parametric-value-element\"));\r\n }\r\n public int getTotalDocNumber(){\r\n int total=0;\r\n for(WebElement element:getChildDocCount()){\r\n \/\/gets text, trims brackets and casts to int\r\n total+=Integer.parseInt(element.getText().replaceAll(\"[()]\",\"\"));\r\n }\r\n return total;\r\n }\r\n\r\n\r\n}","new_contents":"package com.autonomy.abc.selenium.find.filters;\r\n\r\nimport com.hp.autonomy.frontend.selenium.util.ElementUtil;\r\nimport org.openqa.selenium.By;\r\nimport org.openqa.selenium.WebDriver;\r\nimport org.openqa.selenium.WebElement;\r\n\r\nimport java.util.List;\r\n\r\npublic class ParametricFilterNode extends FilterNode {\r\n\r\n ParametricFilterNode(WebElement element, WebDriver webDriver) {\r\n super(element, webDriver);\r\n }\r\n\r\n public List getChildren(){\r\n return getContainer().findElements(By.className(\"parametric-value-name\"));\r\n }\r\n\r\n @Override\r\n public List getChildNames() {\r\n return ElementUtil.getTexts(getChildren());\r\n }\r\n\r\n public List getChildDocCount(){\r\n return getContainer().findElements(By.className(\"parametric-value-count\"));\r\n }\r\n\r\n public List getFullChildrenElements(){\r\n return getContainer().findElements(By.className(\"parametric-value-element\"));\r\n }\r\n public int getTotalDocNumber(){\r\n int total=0;\r\n for(WebElement element:getChildDocCount()){\r\n \/\/gets text, trims brackets and casts to int\r\n total+=Integer.parseInt(element.getText().replaceAll(\"[()]\",\"\"));\r\n }\r\n return total;\r\n }\r\n\r\n\r\n}","subject":"Remove bad import to fix build"} {"old_contents":"package org.ektorp.http;\n\nimport java.util.concurrent.*;\nimport java.util.concurrent.atomic.*;\n\nimport org.apache.http.conn.*;\n\npublic class IdleConnectionMonitor {\n\n\tprivate final static long DEFAULT_IDLE_CHECK_INTERVAL = 30;\n\t\n\tprivate final static ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1, new ThreadFactory() {\n\t\t\n\t\tprivate final AtomicInteger threadCount = new AtomicInteger(0);\n\t\t\n\t\tpublic Thread newThread(Runnable r) {\n\t\t\tThread t = new Thread(r);\n\t\t\tt.setDaemon(true);\n\t\t\tt.setName(String.format(\"ektorp-idle-connection-monitor-thread-%s\", threadCount.incrementAndGet()));\n\t\t\treturn t;\n\t\t}\n\t});\n\t\n\tpublic static void monitor(ClientConnectionManager cm) {\n\t\texecutorService.scheduleWithFixedDelay(new CleanupTask(cm), DEFAULT_IDLE_CHECK_INTERVAL, DEFAULT_IDLE_CHECK_INTERVAL, TimeUnit.SECONDS);\n\t}\n\t\n\tprivate static class CleanupTask implements Runnable {\n\n\t\tfinal ClientConnectionManager cm;\n\t\t\n\t\tCleanupTask(ClientConnectionManager cm) {\n\t\t\tthis.cm = cm;\n\t\t}\n\t\t\n\t\tpublic void run() {\n\t\t\tcm.closeExpiredConnections();\n\t\t}\n\t\t\n\t}\n\t\n}\n","new_contents":"package org.ektorp.http;\n\nimport java.lang.ref.WeakReference;\nimport java.util.concurrent.*;\nimport java.util.concurrent.atomic.*;\n\nimport org.apache.http.conn.*;\n\npublic class IdleConnectionMonitor {\n\n\tprivate final static long DEFAULT_IDLE_CHECK_INTERVAL = 30;\n\t\n\tprivate final static ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1, new ThreadFactory() {\n\t\t\n\t\tprivate final AtomicInteger threadCount = new AtomicInteger(0);\n\t\t\n\t\tpublic Thread newThread(Runnable r) {\n\t\t\tThread t = new Thread(r);\n\t\t\tt.setDaemon(true);\n\t\t\tt.setName(String.format(\"ektorp-idle-connection-monitor-thread-%s\", threadCount.incrementAndGet()));\n\t\t\treturn t;\n\t\t}\n\t});\n\t\n public static void monitor(ClientConnectionManager cm) {\n CleanupTask cleanupTask = new CleanupTask(cm);\n ScheduledFuture cleanupFuture = executorService.scheduleWithFixedDelay(cleanupTask, DEFAULT_IDLE_CHECK_INTERVAL, \n DEFAULT_IDLE_CHECK_INTERVAL, TimeUnit.SECONDS);\n cleanupTask.setFuture(cleanupFuture);\n }\n\t\n\tprivate static class CleanupTask implements Runnable {\n\n private final WeakReference cm;\n private ScheduledFuture thisFuture;\n\n CleanupTask(ClientConnectionManager cm) {\n this.cm = new WeakReference(cm);\n }\n\n public void setFuture(ScheduledFuture future) {\n thisFuture = future;\n }\n\n public void run() {\n if (cm.get() != null) {\n cm.get().closeExpiredConnections();\n } else if (thisFuture != null) {\n thisFuture.cancel(false);\n }\n }\n\t\t\n\t}\n\t\n}\n","subject":"Fix memory leak in cleanup task"} {"old_contents":"\/**\n *\n *\/\npackage test.issues.strava;\n\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertNotNull;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport javastrava.api.v3.model.StravaComment;\nimport javastrava.api.v3.rest.API;\nimport javastrava.api.v3.rest.ActivityAPI;\n\nimport org.junit.Test;\n\nimport test.api.service.impl.util.ActivityServiceUtils;\nimport test.utils.RateLimitedTestRunner;\nimport test.utils.TestUtils;\n\n\/**\n *

      \n * Issue test for issue javastrava-api #67 - tests will PASS if the issue is still a problem\n * <\/p>\n *\n * @author Dan Shannon\n * @see https:\/\/github.com\/danshannon\/javastravav3api\/issues\/67<\/a>\n *\/\npublic class Issue67 {\n\t@Test\n\tpublic void testIssue() throws Exception {\n\t\tRateLimitedTestRunner.run(() -> {\n\t\t\tfinal ActivityAPI api = API.instance(ActivityAPI.class, TestUtils.getValidToken());\n\t\t\tfinal StravaComment comment = ActivityServiceUtils.createPrivateActivityWithComment();\n\t\t\tfinal List comments = Arrays.asList(api.listActivityComments(comment.getActivityId(), null, null, null));\n\t\t\tassertNotNull(comments);\n\t\t\tassertFalse(comments.isEmpty());\n\t\t});\n\t}\n}\n","new_contents":"\/**\n *\n *\/\npackage test.issues.strava;\n\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertNotNull;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport javastrava.api.v3.model.StravaComment;\nimport javastrava.api.v3.rest.API;\nimport javastrava.api.v3.rest.ActivityAPI;\n\nimport org.junit.Test;\n\nimport test.api.service.impl.util.ActivityServiceUtils;\nimport test.utils.RateLimitedTestRunner;\nimport test.utils.TestUtils;\n\n\/**\n *

      \n * Issue test for issue javastrava-api #67 - tests will PASS if the issue is still a problem\n * <\/p>\n *\n * @author Dan Shannon\n * @see https:\/\/github.com\/danshannon\/javastravav3api\/issues\/67<\/a>\n *\/\npublic class Issue67 {\n\t@Test\n\tpublic void testIssue() throws Exception {\n\t\tRateLimitedTestRunner.run(() -> {\n\t\t\tfinal ActivityAPI api = API.instance(ActivityAPI.class, TestUtils.getValidToken());\n\t\t\tfinal StravaComment comment = ActivityServiceUtils.createPrivateActivityWithComment(\"Issue67.testIssue()\");\n\t\t\tfinal List comments = Arrays.asList(api.listActivityComments(comment.getActivityId(), null, null, null));\n\t\t\tassertNotNull(comments);\n\t\t\tassertFalse(comments.isEmpty());\n\t\t});\n\t}\n}\n","subject":"Enforce name conventions for test-created activities"} {"old_contents":"package com.quickblox.sample.videochatwebrtcnew.definitions;\n\npublic class Consts {\n\n \/\/ QuickBlox credentials\n public static final String APP_ID = \"18846\";\n public static final String AUTH_KEY = \"64JzC2cuLkSMUq7\";\n public static final String AUTH_SECRET = \"s4VCJZq4uWNer7H\";\n\n \/*public static final String APP_ID = \"92\";\n public static final String AUTH_KEY = \"wJHdOcQSxXQGWx5\";\n public static final String AUTH_SECRET = \"BTFsj7Rtt27DAmT\";*\/\n public static final String EMPTY_STRING = \"\";\n}\n","new_contents":"package com.quickblox.sample.videochatwebrtcnew.definitions;\n\npublic class Consts {\n\n \/\/ QuickBlox credentials\n \/* public static final String APP_ID = \"18846\";\n public static final String AUTH_KEY = \"64JzC2cuLkSMUq7\";\n public static final String AUTH_SECRET = \"s4VCJZq4uWNer7H\";*\/\n\n public static final String APP_ID = \"92\";\n public static final String AUTH_KEY = \"wJHdOcQSxXQGWx5\";\n public static final String AUTH_SECRET = \"BTFsj7Rtt27DAmT\";\n public static final String EMPTY_STRING = \"\";\n}\n","subject":"Clear data. Refactor peer to peer calls."} {"old_contents":"\/*\n * Copyright 2014 Open mHealth\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.openmhealth.dsu.repository;\n\nimport org.openmhealth.dsu.domain.DataPoint;\nimport org.openmhealth.dsu.domain.DataPointSearchCriteria;\n\nimport javax.annotation.Nullable;\n\n\n\/**\n * A set of data point repository methods not automatically implemented by Spring Data.\n *\n * @author Emerson Farrugia\n *\/\npublic interface CustomDataPointRepository {\n\n Iterable findBySearchCriteria(DataPointSearchCriteria searchCriteria, @Nullable Integer offset,\n @Nullable Integer limit);\n}\n","new_contents":"\/*\n * Copyright 2014 Open mHealth\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.openmhealth.dsu.repository;\n\nimport org.openmhealth.dsu.domain.DataPoint;\nimport org.openmhealth.dsu.domain.DataPointSearchCriteria;\n\nimport javax.annotation.Nullable;\n\n\n\/**\n * A set of data point repository methods not automatically implemented by Spring Data repositories.\n *\n * @author Emerson Farrugia\n *\/\npublic interface CustomDataPointRepository {\n\n Iterable findBySearchCriteria(DataPointSearchCriteria searchCriteria, @Nullable Integer offset,\n @Nullable Integer limit);\n\n \/**\n * Inserts data points, failing if a data point with the same identifier already exists and compensating in case\n * previous inserts were successful.\n *\n * @param dataPoints the data points to insert\n *\/\n void insert(Iterable dataPoints);\n}\n","subject":"Add an insert method to the custom data point repository."} {"old_contents":"\/**\n * Copyright (C) 2011, FuseSource Corp. All rights reserved.\n * http:\/\/fusesource.com\n *\n * The software in this package is published under the terms of the\n * CDDL license a copy of which has been included with this distribution\n * in the license.txt file.\n *\/\npackage org.fusesource.fabric.zookeeper.commands;\n\nimport org.apache.felix.gogo.commands.Argument;\nimport org.apache.felix.gogo.commands.Command;\nimport org.apache.felix.gogo.commands.Option;\n\n@Command(name = \"list\", scope = \"zk\", description = \"List a node's children\")\npublic class List extends ZooKeeperCommandSupport {\n\n @Option(name = \"-r\", aliases = {\"--recursive\"}, description = \"Display children recursively\")\n boolean recursive;\n\n @Argument(description = \"Path of the node to list\", required = true)\n String path;\n\n @Override\n protected Object doExecute() throws Exception {\n display(path);\n return null;\n }\n\n protected void display(String path) throws Exception {\n java.util.List children = getZooKeeper().getChildren(path);\n for (String child : children) {\n String cp = path.endsWith(\"\/\") ? path + child : path + \"\/\" + child;\n System.out.println(cp);\n if (recursive) {\n display(cp);\n }\n }\n }\n}\n","new_contents":"\/**\n * Copyright (C) 2011, FuseSource Corp. All rights reserved.\n * http:\/\/fusesource.com\n *\n * The software in this package is published under the terms of the\n * CDDL license a copy of which has been included with this distribution\n * in the license.txt file.\n *\/\npackage org.fusesource.fabric.zookeeper.commands;\n\nimport org.apache.felix.gogo.commands.Argument;\nimport org.apache.felix.gogo.commands.Command;\nimport org.apache.felix.gogo.commands.Option;\n\n@Command(name = \"list\", scope = \"zk\", description = \"List a node's children\")\npublic class List extends ZooKeeperCommandSupport {\n\n @Argument(description = \"Path of the node to list\")\n String path = \"\/\";\n\n @Option(name = \"-r\", aliases = {\"--recursive\"}, description = \"Display children recursively\")\n boolean recursive = false;\n\n @Option(name=\"-d\", aliases={\"--display\"}, description=\"Display a node's value if set\")\n boolean display = false;\n\n @Override\n protected Object doExecute() throws Exception {\n display(path);\n return null;\n }\n\n protected java.util.List getPaths() throws Exception {\n if (recursive) {\n return getZooKeeper().getAllChildren(path);\n } else {\n return getZooKeeper().getChildren(path);\n }\n }\n\n protected void display(String path) throws Exception {\n java.util.List paths = getPaths();\n\n for(String p : paths) {\n if (display) {\n byte[] data = getZooKeeper().getData(p);\n if (data != null) {\n System.out.printf(\"%s = %s\\n\", p, new String(data));\n } else {\n System.out.println(p);\n }\n } else {\n System.out.println(p);\n }\n }\n }\n}\n","subject":"Improve list command to show values, to use \/ by default, etc"} {"old_contents":"package com.github.robozonky.strategy.natural;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.charset.StandardCharsets;\n\n\/**\n * Used for testing of strategies generated by natural-strategy-setup.\n *\/\npublic class GeneratedStrategyVerifier {\n public static ParsedStrategy parseWithAntlr(final String strategy) throws IOException {\n InputStream strategyStream = new ByteArrayInputStream(strategy.getBytes(StandardCharsets.UTF_8.name()));\n return NaturalLanguageStrategyService.parseWithAntlr(strategyStream);\n }\n}\n","new_contents":"\/*\n * Copyright 2017 The RoboZonky Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.github.robozonky.strategy.natural;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\n\nimport com.github.robozonky.internal.api.Defaults;\n\n\/**\n * Used for testing of strategies generated by natural-strategy-setup.\n *\/\npublic class GeneratedStrategyVerifier {\n\n public static ParsedStrategy parseWithAntlr(final String strategy) throws IOException {\n final InputStream strategyStream = new ByteArrayInputStream(strategy.getBytes(Defaults.CHARSET));\n return NaturalLanguageStrategyService.parseWithAntlr(strategyStream);\n }\n}\n","subject":"Bring the verifier up to code conventions"} {"old_contents":"\/***********************************************************************\n * Copyright (c) 2009 Actuate Corporation.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *\n * Contributors:\n * Actuate Corporation - initial API and implementation\n ***********************************************************************\/\n\npackage org.eclipse.birt.report.engine.nLayout.area.impl;\n\nimport org.eclipse.birt.core.exception.BirtException;\nimport org.eclipse.birt.report.engine.nLayout.area.IContainerArea;\n\npublic class HtmlRegionArea extends RegionArea implements IContainerArea\n{\n\tpublic HtmlRegionArea( )\n\t{\n\t\tsuper( );\n\t}\n\n\tHtmlRegionArea( HtmlRegionArea area )\n\t{\n\t\tsuper( area );\n\t}\n\t\n\tpublic void close( ) throws BirtException\n\t{\n\t\tif ( specifiedHeight >= currentBP )\n\t\t{\t\n\t\t\tfinished = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinished = false;\n\t\t}\n\t\tsetContentHeight( specifiedHeight );\n\t\tcheckDisplayNone( );\n\t}\n\t\n\tpublic void update( AbstractArea area ) throws BirtException\n\t{\n\t\tint aHeight = area.getAllocatedHeight( );\n\t\tcurrentBP += aHeight;\n\t\tif ( currentIP + area.getAllocatedWidth( ) > maxAvaWidth )\n\t\t{\n\t\t\tsetNeedClip( true );\n\t\t}\n\t}\n\t\n\tpublic boolean isFinished( )\n\t{\n\t\treturn finished;\n\t}\n\n}\n","new_contents":"\/***********************************************************************\n * Copyright (c) 2009 Actuate Corporation.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *\n * Contributors:\n * Actuate Corporation - initial API and implementation\n ***********************************************************************\/\n\npackage org.eclipse.birt.report.engine.nLayout.area.impl;\n\nimport org.eclipse.birt.core.exception.BirtException;\nimport org.eclipse.birt.report.engine.nLayout.area.IContainerArea;\n\npublic class HtmlRegionArea extends RegionArea implements IContainerArea\n{\n\tpublic HtmlRegionArea( )\n\t{\n\t\tsuper( );\n\t}\n\n\tHtmlRegionArea( HtmlRegionArea area )\n\t{\n\t\tsuper( area );\n\t}\n\t\n\tpublic void close( ) throws BirtException\n\t{\n\t\tif ( specifiedHeight >= currentBP )\n\t\t{\t\n\t\t\tfinished = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinished = false;\n\t\t}\n\t\tsetContentHeight( specifiedHeight );\n\t}\n\t\n\tpublic void update( AbstractArea area ) throws BirtException\n\t{\n\t\tint aHeight = area.getAllocatedHeight( );\n\t\tcurrentBP += aHeight;\n\t\tif ( currentIP + area.getAllocatedWidth( ) > maxAvaWidth )\n\t\t{\n\t\t\tsetNeedClip( true );\n\t\t}\n\t}\n\t\n\tpublic boolean isFinished( )\n\t{\n\t\treturn finished;\n\t}\n\n}\n","subject":"Fix T41937: NPE when render report with large line height and letter spacing styles in item"} {"old_contents":"package com.nokia.springboot.training.d04.s01.service;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\nimport org.springframework.util.concurrent.ListenableFuture;\n\nimport java.util.concurrent.CompletableFuture;\nimport java.util.concurrent.ExecutionException;\nimport java.util.concurrent.Future;\n\n@Service\npublic class ProductService {\n\n private final AsyncComponent asyncComponent;\n\n @Autowired\n public ProductService(final AsyncComponent asyncComponent) {\n this.asyncComponent = asyncComponent;\n }\n\n public void voidAsyncCall() {\n asyncComponent.voidAsyncCall();\n }\n\n public void getFuture() {\n final Future future = asyncComponent.getFuture();\n\n try {\n getAndDisplayValue(future);\n } catch (final ExecutionException | InterruptedException e) {\n handleException(e);\n }\n }\n\n public void getCompletableFuture() {\n final CompletableFuture completableFuture = asyncComponent.getCompletableFuture();\n\n try {\n getAndDisplayValue(completableFuture);\n } catch (final ExecutionException | InterruptedException e) {\n handleException(e);\n }\n }\n\n private void getAndDisplayValue(final Future futureValue)\n throws ExecutionException, InterruptedException {\n\n if (futureValue.isDone()) {\n final String theValue = futureValue.get();\n System.out.println(\"The \" + futureValue.getClass().getSimpleName() + \" value is '\" + theValue + \"'\");\n }\n }\n\n private void handleException(final Exception ex) {\n ex.printStackTrace();\n }\n}\n","new_contents":"package com.nokia.springboot.training.d04.s01.service;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\nimport org.springframework.util.concurrent.ListenableFuture;\n\nimport java.util.concurrent.CompletableFuture;\nimport java.util.concurrent.ExecutionException;\nimport java.util.concurrent.Future;\n\n@Service\npublic class ProductService {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(ProductService.class);\n\n private final AsyncComponent asyncComponent;\n\n @Autowired\n public ProductService(final AsyncComponent asyncComponent) {\n this.asyncComponent = asyncComponent;\n }\n\n public void voidAsyncCall() {\n asyncComponent.voidAsyncCall();\n }\n\n public void getFuture() {\n final Future future = asyncComponent.getFuture();\n\n try {\n getAndDisplayValue(future, \"Future\");\n } catch (final ExecutionException | InterruptedException e) {\n handleException(e);\n }\n }\n\n public void getCompletableFuture() {\n final CompletableFuture completableFuture = asyncComponent.getCompletableFuture();\n\n try {\n getAndDisplayValue(completableFuture, \"CompletableFuture\");\n } catch (final ExecutionException | InterruptedException e) {\n handleException(e);\n }\n }\n\n private void getAndDisplayValue(final Future futureValue, final String className)\n throws ExecutionException, InterruptedException {\n\n if (futureValue.isDone()) {\n final String theValue = futureValue.get();\n LOGGER.info(\"The {} value is '{}'\", className, theValue);\n }\n }\n\n private void handleException(final Exception ex) {\n ex.printStackTrace();\n }\n}\n","subject":"Use a logger instead of System.out, display the class name"} {"old_contents":"package org.ovirt.engine.core.common.queries;\n\npublic class GetConfigurationValueParameters extends VdcQueryParametersBase {\n private static final long serialVersionUID = -5889171970595969719L;\n\n public GetConfigurationValueParameters(ConfigurationValues cVal) {\n _configValue = cVal;\n }\n\n private ConfigurationValues _configValue;\n\n public ConfigurationValues getConfigValue() {\n return _configValue;\n }\n\n private String privateVersion;\n\n public String getVersion() {\n return privateVersion;\n }\n\n public void setVersion(String value) {\n privateVersion = value;\n }\n\n public GetConfigurationValueParameters(ConfigurationValues cVal, String version) {\n _configValue = cVal;\n privateVersion = version;\n }\n\n public GetConfigurationValueParameters() {\n _configValue = ConfigurationValues.MaxNumOfVmCpus;\n }\n\n @Override\n public String toString() {\n StringBuilder builder = new StringBuilder(50);\n builder.append(\"version: \"); \/\/$NON-NLS-1$\n builder.append(getVersion());\n builder.append(\", configuration value: \");\n builder.append(getConfigValue());\n builder.append(\", \");\n builder.append(super.toString());\n return builder.toString();\n }\n}\n","new_contents":"package org.ovirt.engine.core.common.queries;\n\npublic class GetConfigurationValueParameters extends VdcQueryParametersBase {\n private static final long serialVersionUID = -5889171970595969719L;\n\n public GetConfigurationValueParameters(ConfigurationValues cVal) {\n this(cVal, null);\n }\n\n private ConfigurationValues _configValue;\n\n public ConfigurationValues getConfigValue() {\n return _configValue;\n }\n\n private String privateVersion;\n\n public String getVersion() {\n return privateVersion;\n }\n\n public void setVersion(String value) {\n privateVersion = value;\n }\n\n public GetConfigurationValueParameters(ConfigurationValues cVal, String version) {\n _configValue = cVal;\n privateVersion = version;\n setRefresh(false);\n }\n\n public GetConfigurationValueParameters() {\n this(ConfigurationValues.MaxNumOfVmCpus);\n }\n\n @Override\n public String toString() {\n StringBuilder builder = new StringBuilder(50);\n builder.append(\"version: \"); \/\/$NON-NLS-1$\n builder.append(getVersion());\n builder.append(\", configuration value: \");\n builder.append(getConfigValue());\n builder.append(\", \");\n builder.append(super.toString());\n return builder.toString();\n }\n}\n","subject":"Change GetConfiguration query not to refresh session"} {"old_contents":"package no.steria.skuldsku.example.basic.impl;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nimport no.steria.skuldsku.example.basic.PlaceDao;\r\n\r\npublic class InMemoryPlaceDao implements PlaceDao {\r\n private static List places = new ArrayList<>();\r\n\r\n private static void add(String name) {\r\n synchronized (places) {\r\n places.add(name);\r\n }\r\n }\r\n\r\n private static List all() {\r\n synchronized (places) {\r\n return new ArrayList<>(places);\r\n }\r\n }\r\n\r\n @Override\r\n public void addPlace(String name) {\r\n \/\/InMemoryPlaceDao.add(name);\r\n }\r\n\r\n @Override\r\n public List findMatches(String part) {\r\n if (part == null) {\r\n return all();\r\n }\r\n ArrayList result = new ArrayList<>();\r\n for (String place : all()) {\r\n if (place.toUpperCase().contains(part.toUpperCase())) {\r\n result.add(place);\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n","new_contents":"package no.steria.skuldsku.example.basic.impl;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nimport no.steria.skuldsku.example.basic.PlaceDao;\r\n\r\npublic class InMemoryPlaceDao implements PlaceDao {\r\n private static List places = new ArrayList<>();\r\n\r\n private static void add(String name) {\r\n synchronized (places) {\r\n places.add(name);\r\n }\r\n }\r\n\r\n private static List all() {\r\n synchronized (places) {\r\n return new ArrayList<>(places);\r\n }\r\n }\r\n\r\n @Override\r\n public void addPlace(String name) {\r\n InMemoryPlaceDao.add(name);\r\n }\r\n\r\n @Override\r\n public List findMatches(String part) {\r\n if (part == null) {\r\n return all();\r\n }\r\n ArrayList result = new ArrayList<>();\r\n for (String place : all()) {\r\n if (place.toUpperCase().contains(part.toUpperCase())) {\r\n result.add(place);\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n","subject":"Remove result of running demo."} {"old_contents":"package org.innovateuk.ifs.competition.status;\n\nimport org.junit.Assert;\nimport org.junit.Test;\n\npublic class PublicContentStatusTextTest {\n\n PublicContentStatusText publicContentStatusText;\n\n @Test\n public void getPredicate() throws Exception {\n }\n\n @Test\n public void getHeader() throws Exception {\n String result = publicContentStatusText.CLOSING_SOON.getHeader();\n Assert.assertEquals( \"Closing soon\", result);\n }\n\n @Test\n public void getOpenTense() throws Exception {\n String result = publicContentStatusText.CLOSING_SOON.getOpenTense();\n Assert.assertEquals( \"Opened\", result);\n }\n}","new_contents":"package org.innovateuk.ifs.competition.status;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\npublic class PublicContentStatusTextTest {\n\n PublicContentStatusText publicContentStatusText;\n\n @Test\n public void getHeader() throws Exception {\n assertEquals(\"Closing soon\", publicContentStatusText.CLOSING_SOON.getHeader());\n }\n\n @Test\n public void getOpenTense() throws Exception {\n assertEquals(\"Opened\", publicContentStatusText.CLOSING_SOON.getOpenTense());\n }\n}","subject":"Update to PublicContentStatusText unit test."} {"old_contents":"package org.monospark.actionpermissions;\n\nimport org.spongepowered.api.plugin.Plugin;\n\n@Plugin(id = \"actionpermissions\", name = \"ActionPermissions\", version = \"1.0\")\npublic class ActionPermissions {\n\n}\n","new_contents":"package org.monospark.actionpermissions;\n\nimport java.nio.file.Path;\n\nimport org.monospark.actionpermissions.config.ConfigParseException;\nimport org.monospark.actionpermissions.group.Group;\nimport org.monospark.actionpermissions.handler.ActionHandler;\nimport org.spongepowered.api.Sponge;\nimport org.spongepowered.api.config.ConfigDir;\nimport org.spongepowered.api.event.Event;\nimport org.spongepowered.api.event.Listener;\nimport org.spongepowered.api.event.game.state.GameInitializationEvent;\nimport org.spongepowered.api.plugin.Plugin;\n\nimport com.google.inject.Inject;\n\n@Plugin(id = \"actionpermissions\", name = \"ActionPermissions\", version = \"1.0\")\npublic class ActionPermissions {\n\t\n\t@Inject\n\t@ConfigDir(sharedRoot = false)\n\tprivate Path privateConfigDir;\n\t\n\t@Listener\n\tpublic void onServerInit(GameInitializationEvent event) {\n\t\tfor(ActionHandler handler : ActionHandler.ALL) {\n\t\t\tregisterActionHandler(handler);\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tGroup.getRegistry().loadGroups(privateConfigDir);\n\t\t} catch (ConfigParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\t\n\tprivate void registerActionHandler(ActionHandler handler) {\n\t\tSponge.getGame().getEventManager().registerListener(this, handler.getEventClass(), handler);\n\t}\n}\n","subject":"Load the group config on startup"} {"old_contents":"package edu.stuy.starlorn.upgrades;\n\npublic class SpeedShotUpgrade extends GunUpgrade {\n public SpeedShotUpgrade() {\n super();\n _name = \"Speed Shot\";\n _description = \"Shot Speed x 2!\";\n }\n\n @Override\n public double getShotSpeed(double shotspeed) {\n return shotspeed * 2;\n }\n\n @Override\n public Upgrade clone() {\n return new SpeedShotUpgrade();\n }\n}\n","new_contents":"package edu.stuy.starlorn.upgrades;\n\npublic class SpeedShotUpgrade extends GunUpgrade {\n public SpeedShotUpgrade() {\n super();\n _name = \"Speed Shot\";\n _description = \"Shot Speed x 2!\";\n }\n\n @Override\n public double getShotSpeed(double shotspeed) {\n return shotspeed * 2;\n }\n\n @Override\n public double getCooldown(double cooldown) {\n return cooldown * .9;\n }\n\n @Override\n public Upgrade clone() {\n return new SpeedShotUpgrade();\n }\n}\n","subject":"Add a slight cooldown buff to speedshot to make it less crappy"} {"old_contents":"package digital.loom.rhizome.authentication;\n\nimport java.util.regex.Pattern;\n\nimport javax.servlet.http.Cookie;\nimport javax.servlet.http.HttpServletRequest;\n\nimport com.auth0.jwt.internal.org.apache.commons.lang3.StringUtils;\nimport com.auth0.spring.security.api.Auth0AuthenticationFilter;\nimport com.google.common.base.MoreObjects;\n\npublic class CookieReadingAuth0AuthenticationFilter extends Auth0AuthenticationFilter {\n @Override\n protected String getToken( HttpServletRequest httpRequest ) {\n String authorizationCookie = null;\n Cookie[] cookies = httpRequest.getCookies();\n if ( cookies != null ) {\n for ( Cookie cookie : httpRequest.getCookies() ) {\n if ( StringUtils.equals( cookie.getName(), \"authorization\" ) ) {\n authorizationCookie = cookie.getValue();\n break;\n }\n }\n }\n\n final String authorizationHeader = httpRequest.getHeader( \"authorization\" );\n\n final String[] parts = MoreObjects.firstNonNull( authorizationHeader, authorizationCookie ).split( \" \" );\n if ( parts.length != 2 ) {\n \/\/ \"Unauthorized: Format is Authorization: Bearer [token]\"\n return null;\n }\n final String scheme = parts[ 0 ];\n final String credentials = parts[ 1 ];\n final Pattern pattern = Pattern.compile( \"^Bearer$\", Pattern.CASE_INSENSITIVE );\n return pattern.matcher( scheme ).matches() ? credentials : null;\n }\n}\n","new_contents":"package digital.loom.rhizome.authentication;\n\nimport java.util.regex.Pattern;\n\nimport javax.servlet.http.Cookie;\nimport javax.servlet.http.HttpServletRequest;\n\nimport com.auth0.jwt.internal.org.apache.commons.lang3.StringUtils;\nimport com.auth0.spring.security.api.Auth0AuthenticationFilter;\nimport com.google.common.base.MoreObjects;\n\npublic class CookieReadingAuth0AuthenticationFilter extends Auth0AuthenticationFilter {\n @Override\n protected String getToken( HttpServletRequest httpRequest ) {\n String authorizationCookie = null;\n Cookie[] cookies = httpRequest.getCookies();\n if ( cookies != null ) {\n for ( Cookie cookie : httpRequest.getCookies() ) {\n if ( StringUtils.equals( cookie.getName(), \"authorization\" ) ) {\n authorizationCookie = cookie.getValue();\n break;\n }\n }\n }\n\n final String authorizationInfo = MoreObjects.firstNonNull( httpRequest.getHeader( \"authorization\" ), authorizationCookie ); \n if( authorizationInfo == null ) {\n return null;\n }\n final String[] parts = authorizationInfo.split( \" \" );\n \n if ( parts.length != 2 ) {\n \/\/ \"Unauthorized: Format is Authorization: Bearer [token]\"\n return null;\n }\n final String scheme = parts[ 0 ];\n final String credentials = parts[ 1 ];\n final Pattern pattern = Pattern.compile( \"^Bearer$\", Pattern.CASE_INSENSITIVE );\n return pattern.matcher( scheme ).matches() ? credentials : null;\n }\n}\n","subject":"Fix NPE if no auth info provided"} {"old_contents":"package com.veyndan.redditclient.post.mutator;\n\nimport com.google.common.collect.ImmutableList;\nimport com.veyndan.redditclient.post.model.Post;\n\nimport java.util.List;\n\nimport rx.functions.Action1;\n\npublic final class Mutators {\n\n \/**\n * All available mutator factories.\n *

      \n * Note that the order of the mutator factories is the order in which the post will be mutated.\n *\/\n private static final List MUTATOR_FACTORIES = ImmutableList.of(\n TextMutatorFactory.create(),\n LinkImageMutatorFactory.create(),\n LinkMutatorFactory.create(),\n ImgurMutatorFactory.create(),\n TwitterMutatorFactory.create(),\n XkcdMutatorFactory.create()\n );\n\n \/**\n * Mutate a list of posts by all the available mutator factories.\n *\/\n public Action1 mutate() {\n return post -> {\n for (final MutatorFactory mutatorFactory : MUTATOR_FACTORIES) {\n if (mutatorFactory.applicable(post)) mutatorFactory.mutate(post);\n }\n };\n }\n}\n","new_contents":"package com.veyndan.redditclient.post.mutator;\n\nimport com.google.common.collect.ImmutableList;\nimport com.veyndan.redditclient.post.model.Post;\n\nimport java.util.List;\n\nimport rx.functions.Action1;\n\npublic final class Mutators {\n\n \/**\n * All available mutator factories.\n *

      \n * Note that the order of the mutator factories is the order in which the post will be\n * checked for applicability of mutation.\n *

      \n * Example if the {@link TwitterMutatorFactory} was set\n * after {@link LinkMutatorFactory} then the post would see if the {@link LinkMutatorFactory} is\n * applicable to mutate the post first, and if {@code false}, then {@link TwitterMutatorFactory}\n * would check if it is applicable. In this case the {@link TwitterMutatorFactory} would never\n * be checked for applicability or be applicable, as if the post contains a link, then\n * {@link LinkMutatorFactory} would be applicable, then mutation would stop. If\n * {@link LinkMutatorFactory} isn't applicable, then the post doesn't have a link, so\n * {@link TwitterMutatorFactory} would never be applicable. Obviously this means that\n * {@link LinkMutatorFactory} should occur after<\/em><\/b> {@link TwitterMutatorFactory}.\n *\/\n private static final List MUTATOR_FACTORIES = ImmutableList.of(\n TwitterMutatorFactory.create(),\n XkcdMutatorFactory.create(),\n ImgurMutatorFactory.create(),\n TextMutatorFactory.create(),\n LinkImageMutatorFactory.create(),\n LinkMutatorFactory.create()\n );\n\n \/**\n * Mutate a list of posts by the first mutator which is applicable to mutate the post.\n *\/\n public Action1 mutate() {\n return post -> {\n for (final MutatorFactory mutatorFactory : MUTATOR_FACTORIES) {\n if (mutatorFactory.applicable(post)) {\n mutatorFactory.mutate(post);\n return;\n }\n }\n };\n }\n}\n","subject":"Stop mutating a post after the first applicable mutation"} {"old_contents":"package de.philipphager.disclosure.util.time;\n\nimport javax.inject.Inject;\nimport org.threeten.bp.Duration;\nimport org.threeten.bp.LocalDateTime;\n\nimport static de.philipphager.disclosure.util.assertion.Assertions.ensureNotNull;\n\npublic class Stopwatch {\n private static final int MILLIS = 1000;\n private final Clock clock;\n private LocalDateTime startedAt;\n private Duration duration;\n\n @Inject public Stopwatch(Clock clock) {\n this.clock = clock;\n }\n\n public void start() {\n startedAt = clock.now();\n }\n\n public void stop() {\n ensureNotNull(startedAt, \"called stop() before start()\");\n LocalDateTime endedAt = clock.now();\n duration = Duration.between(startedAt, endedAt);\n startedAt = null;\n }\n\n public Duration getDuration() {\n return duration;\n }\n\n private double toSecs() {\n return duration.toMillis() \/ MILLIS;\n }\n\n @Override public String toString() {\n return String.format(\"duration %s sec.\", toSecs());\n }\n}\n","new_contents":"package de.philipphager.disclosure.util.time;\n\nimport javax.inject.Inject;\nimport org.threeten.bp.Duration;\nimport org.threeten.bp.LocalDateTime;\n\nimport static de.philipphager.disclosure.util.assertion.Assertions.ensureNotNull;\n\npublic class Stopwatch {\n private static final int MILLIS = 1000;\n private final Clock clock;\n private LocalDateTime startedAt;\n private Duration duration;\n\n @Inject public Stopwatch(Clock clock) {\n this.clock = clock;\n }\n\n public void start() {\n startedAt = clock.now();\n }\n\n public void stop() {\n ensureNotNull(startedAt, \"called stop() before start()\");\n LocalDateTime endedAt = clock.now();\n duration = Duration.between(startedAt, endedAt);\n startedAt = null;\n }\n\n public Duration getDuration() {\n return duration;\n }\n\n private double toSecs() {\n return duration.toMillis() \/ (double) MILLIS;\n }\n\n @Override public String toString() {\n return String.format(\"duration %s sec.\", toSecs());\n }\n}\n","subject":"Remove implicit cast to fix second conversion"} {"old_contents":"package com.ca.apm.swat.epaplugins.asm.har;\n\nimport org.eclipse.swt.browser.Browser;\n\npublic interface Log {\n public String getVersion();\n public Creator getCreator();\n @OptionalItem\n public Browser getBrowser();\n @IterableClass(type = Page.class)\n @OptionalItem\n public Iterable getPages();\n @OptionalItem\n @IterableClass(type = Entry.class)\n public Iterable getEntries();\n public String getComment();\n}\n","new_contents":"package com.ca.apm.swat.epaplugins.asm.har;\n\npublic interface Log {\n public String getVersion();\n public Creator getCreator();\n @OptionalItem\n public Browser getBrowser();\n @IterableClass(type = Page.class)\n @OptionalItem\n public Iterable getPages();\n @OptionalItem\n @IterableClass(type = Entry.class)\n public Iterable getEntries();\n public String getComment();\n}\n","subject":"Remove the import org.eclipse.swt.browser.Browser - instead it shoult be the Browser interface that is in this package"} {"old_contents":"package com.tinkerpop.gremlin.console.plugin;\n\nimport com.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;\nimport com.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;\nimport org.codehaus.groovy.tools.shell.Groovysh;\nimport org.codehaus.groovy.tools.shell.IO;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport static org.junit.Assert.assertEquals;\n\n\/**\n * @author Stephen Mallette (http:\/\/stephen.genoprime.com)\n *\/\npublic class SugarGremlinPluginTest {\n @Test\n public void shouldPluginSugar() throws Exception {\n final SugarGremlinPlugin plugin = new SugarGremlinPlugin();\n\n final Groovysh groovysh = new Groovysh();\n\n final Map env = new HashMap<>();\n env.put(\"ConsolePluginAcceptor.io\", new IO());\n env.put(\"ConsolePluginAcceptor.shell\", groovysh);\n\n final SpyPluginAcceptor spy = new SpyPluginAcceptor(groovysh::execute, () -> env);\n plugin.pluginTo(spy);\n\n groovysh.getInterp().getContext().setProperty(\"g\", TinkerFactory.createClassic());\n assertEquals(6l, groovysh.execute(\"g.V().count().next()\"));\n assertEquals(6l, groovysh.execute(\"g.V.count().next()\"));\n }\n}\n","new_contents":"package com.tinkerpop.gremlin.console.plugin;\n\nimport com.tinkerpop.gremlin.process.graph.GraphTraversal;\nimport com.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;\nimport org.codehaus.groovy.tools.shell.Groovysh;\nimport org.codehaus.groovy.tools.shell.IO;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport static org.junit.Assert.assertEquals;\n\n\/**\n * @author Stephen Mallette (http:\/\/stephen.genoprime.com)\n *\/\npublic class SugarGremlinPluginTest {\n @Test\n public void shouldPluginSugar() throws Exception {\n final SugarGremlinPlugin plugin = new SugarGremlinPlugin();\n\n final Groovysh groovysh = new Groovysh();\n\n final Map env = new HashMap<>();\n env.put(\"ConsolePluginAcceptor.io\", new IO());\n env.put(\"ConsolePluginAcceptor.shell\", groovysh);\n\n final SpyPluginAcceptor spy = new SpyPluginAcceptor(groovysh::execute, () -> env);\n plugin.pluginTo(spy);\n\n groovysh.getInterp().getContext().setProperty(\"g\", TinkerFactory.createClassic());\n assertEquals(6l, ((GraphTraversal) groovysh.execute(\"g.V()\")).count().next());\n assertEquals(6l, ((GraphTraversal) groovysh.execute(\"g.V\")).count().next());\n }\n}\n","subject":"Make travis happy - maybe."} {"old_contents":"package com.litl.leveldb;\n\nimport java.io.Closeable;\nimport java.util.concurrent.atomic.AtomicInteger;\n\nabstract class NativeObject implements Closeable {\n protected long mPtr;\n private AtomicInteger mRefCount = new AtomicInteger();\n\n protected NativeObject() {\n \/\/ The Java wrapper counts as one reference, will\n \/\/ be released when closed\n ref();\n }\n\n protected NativeObject(long ptr) {\n this();\n\n if (ptr == 0) {\n throw new OutOfMemoryError(\"Failed to allocate native object\");\n }\n\n mPtr = ptr;\n }\n\n protected long getPtr() {\n return mPtr;\n }\n\n protected void assertOpen(String message) {\n if (mPtr == 0) {\n throw new IllegalStateException(message);\n }\n }\n\n void ref() {\n mRefCount.incrementAndGet();\n }\n\n void unref() {\n if (mRefCount.decrementAndGet() == 0) {\n closeNativeObject(mPtr);\n mPtr = 0;\n }\n }\n\n protected abstract void closeNativeObject(long ptr);\n\n @Override\n public void close() {\n unref();\n }\n}\n","new_contents":"package com.litl.leveldb;\n\nimport java.io.Closeable;\nimport java.util.concurrent.atomic.AtomicInteger;\n\nimport android.util.Log;\n\nabstract class NativeObject implements Closeable {\n private static final String TAG = NativeObject.class.getSimpleName();\n protected long mPtr;\n private AtomicInteger mRefCount = new AtomicInteger();\n\n protected NativeObject() {\n \/\/ The Java wrapper counts as one reference, will\n \/\/ be released when closed\n ref();\n }\n\n protected NativeObject(long ptr) {\n this();\n\n if (ptr == 0) {\n throw new OutOfMemoryError(\"Failed to allocate native object\");\n }\n\n mPtr = ptr;\n }\n\n protected long getPtr() {\n return mPtr;\n }\n\n protected void assertOpen(String message) {\n if (mPtr == 0) {\n throw new IllegalStateException(message);\n }\n }\n\n void ref() {\n mRefCount.incrementAndGet();\n }\n\n void unref() {\n if (mRefCount.decrementAndGet() == 0) {\n closeNativeObject(mPtr);\n mPtr = 0;\n }\n }\n\n protected abstract void closeNativeObject(long ptr);\n\n @Override\n public void close() {\n unref();\n }\n\n @Override\n protected void finalize() throws Throwable {\n if (mPtr != 0) {\n Log.w(TAG,\n \"NativeObject \"\n + getClass().getSimpleName()\n + \" was finalized before native resource was closed, did you forget to call close()?\");\n }\n\n super.finalize();\n }\n}\n","subject":"Add a warning if resources are leaked."} {"old_contents":"package org.kikermo.blepotcontroller.activity;\n\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\nimport android.widget.SeekBar;\nimport android.widget.TextView;\n\nimport org.kikermo.blepotcontroller.R;\n\npublic class MainActivity extends AppCompatActivity implements SeekBar.OnSeekBarChangeListener {\n private TextView value;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n value = (TextView) findViewById(R.id.value);\n ((SeekBar)findViewById(R.id.pot)).setOnSeekBarChangeListener(this);\n }\n\n @Override\n public void onProgressChanged(SeekBar seekBar, int i, boolean b) {\n\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n\n }\n}\n","new_contents":"package org.kikermo.blepotcontroller.activity;\n\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\nimport android.widget.SeekBar;\nimport android.widget.TextView;\n\nimport org.kikermo.blepotcontroller.R;\n\npublic class MainActivity extends AppCompatActivity implements SeekBar.OnSeekBarChangeListener {\n private TextView value;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n value = (TextView) findViewById(R.id.value);\n ((SeekBar) findViewById(R.id.pot)).setOnSeekBarChangeListener(this);\n }\n\n @Override\n public void onProgressChanged(SeekBar seekBar, int i, boolean b) {\n value.setText(i + \"%\");\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n\n }\n}\n","subject":"Add simple UI for first example"} {"old_contents":"package dk.statsbiblioteket.doms.transformers.common;\n\nimport junit.framework.TestCase;\nimport org.junit.Test;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.List;\n\n\/**\n * Test file reader.\n *\/\npublic class TrivialUuidFileReaderTest extends TestCase {\n @Test\n public void testReadUuids() throws IOException {\n List uuids = new TrivialUuidFileReader().readUuids(new File(\"src\/test\/resources\/uuids.txt\"));\n assertEquals(2, uuids.size());\n assertEquals(\"uuid:cb8da856-fae8-473f-9070-8d24b5a84cfc\", uuids.get(0));\n assertEquals(\"uuid:99c1b516-3ea9-49ce-bfbc-ae1ea8faf0e3\", uuids.get(1));\n }\n}\n","new_contents":"package dk.statsbiblioteket.doms.transformers.common;\n\nimport junit.framework.TestCase;\nimport org.junit.Test;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.List;\n\n\/**\n * Test file reader.\n *\/\npublic class TrivialUuidFileReaderTest extends TestCase {\n @Test\n public void testReadUuids() throws IOException {\n List uuids = new TrivialUuidFileReader().readUuids(new File(getClass().getClassLoader().getResource(\"uuids.txt\").getPath()));\n assertEquals(2, uuids.size());\n assertEquals(\"uuid:cb8da856-fae8-473f-9070-8d24b5a84cfc\", uuids.get(0));\n assertEquals(\"uuid:99c1b516-3ea9-49ce-bfbc-ae1ea8faf0e3\", uuids.get(1));\n }\n}\n","subject":"Make test independent of current working directory"} {"old_contents":"package devopsdistilled.operp.server.data.service.items.impl;\n\nimport javax.inject.Inject;\n\nimport org.springframework.stereotype.Service;\n\nimport devopsdistilled.operp.server.data.entity.items.Category;\nimport devopsdistilled.operp.server.data.repo.items.CategoryRepository;\nimport devopsdistilled.operp.server.data.service.impl.AbstractEntityService;\nimport devopsdistilled.operp.server.data.service.items.CategoryService;\n\n@Service\npublic class CategoryServiceImpl extends\n\t\tAbstractEntityService implements\n\t\tCategoryService {\n\n\tprivate static final long serialVersionUID = 7024824459392415034L;\n\n\t@Inject\n\tprivate CategoryRepository repo;\n\n\t@Override\n\tprotected CategoryRepository getRepo() {\n\t\treturn repo;\n\t}\n\n\t@Override\n\tpublic boolean isCategoryNameExists(String categoryName) {\n\t\tCategory category = repo.findByCategoryName(categoryName);\n\t\tif (category != null)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic boolean isCategoryNameValidForCategory(Long categoryId,\n\t\t\tString categoryName) {\n\n\t\tCategory category = repo.findByCategoryName(categoryName);\n\n\t\tif (category == null)\n\t\t\treturn true;\n\n\t\tif (category.getCategoryId() != categoryId)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}\n\n}\n","new_contents":"package devopsdistilled.operp.server.data.service.items.impl;\n\nimport javax.inject.Inject;\n\nimport org.springframework.stereotype.Service;\n\nimport devopsdistilled.operp.server.data.entity.items.Category;\nimport devopsdistilled.operp.server.data.repo.items.CategoryRepository;\nimport devopsdistilled.operp.server.data.service.impl.AbstractEntityService;\nimport devopsdistilled.operp.server.data.service.items.CategoryService;\n\n@Service\npublic class CategoryServiceImpl extends\n\t\tAbstractEntityService implements\n\t\tCategoryService {\n\n\tprivate static final long serialVersionUID = 7024824459392415034L;\n\n\t@Inject\n\tprivate CategoryRepository repo;\n\n\t@Override\n\tprotected CategoryRepository getRepo() {\n\t\treturn repo;\n\t}\n\n\t@Override\n\tpublic boolean isCategoryNameExists(String categoryName) {\n\t\tCategory category = repo.findByCategoryName(categoryName);\n\t\tif (category != null)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic boolean isCategoryNameValidForCategory(Long categoryId,\n\t\t\tString categoryName) {\n\n\t\tCategory category = repo.findByCategoryName(categoryName);\n\n\t\tif (category == null)\n\t\t\treturn true;\n\n\t\tif (category.getCategoryId().equals(categoryId))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}\n\n}\n","subject":"Correct logic for is isCategoryNameValidForCategory()"} {"old_contents":"package alien4cloud.metaproperty;\n\nimport com.google.common.collect.Lists;\nimport org.elasticsearch.mapping.IFacetBuilderHelper;\nimport org.elasticsearch.mapping.TermsFilterBuilderHelper;\nimport org.elasticsearch.search.aggregations.AggregationBuilder;\nimport org.elasticsearch.search.aggregations.AggregationBuilders;\nimport org.elasticsearch.search.aggregations.bucket.missing.MissingAggregationBuilder;\nimport org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;\n\nimport java.util.List;\n\nclass MetaPropertyAggregationBuilderHelper extends TermsFilterBuilderHelper implements IFacetBuilderHelper {\n\n private final int size;\n\n MetaPropertyAggregationBuilderHelper(String nestedPath,String esFieldName) {\n super(false,nestedPath,esFieldName);\n\n this.size = 10;\n }\n\n @Override\n public List buildFacets() {\n TermsAggregationBuilder termsBuilder = AggregationBuilders.terms(getEsFieldName()).field(getEsFieldName()+\".keyword\").size(size);\n MissingAggregationBuilder missingBuilder = AggregationBuilders.missing(\"missing_\" + getEsFieldName()).field(getEsFieldName()+\".keyword\");\n\n return Lists.newArrayList(termsBuilder, missingBuilder);\n }\n}\n","new_contents":"package alien4cloud.metaproperty;\n\nimport com.google.common.collect.Lists;\nimport org.elasticsearch.index.query.ExistsQueryBuilder;\nimport org.elasticsearch.index.query.QueryBuilder;\nimport org.elasticsearch.index.query.QueryBuilders;\nimport org.elasticsearch.mapping.IFacetBuilderHelper;\nimport org.elasticsearch.mapping.TermsFilterBuilderHelper;\nimport org.elasticsearch.search.aggregations.AggregationBuilder;\nimport org.elasticsearch.search.aggregations.AggregationBuilders;\nimport org.elasticsearch.search.aggregations.bucket.missing.MissingAggregationBuilder;\nimport org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;\n\nimport java.util.List;\n\nclass MetaPropertyAggregationBuilderHelper extends TermsFilterBuilderHelper implements IFacetBuilderHelper {\n\n private final int size;\n\n MetaPropertyAggregationBuilderHelper(String nestedPath,String esFieldName) {\n super(false,nestedPath,esFieldName );\n\n this.size = 10;\n }\n\n @Override\n public List buildFacets() {\n TermsAggregationBuilder termsBuilder = AggregationBuilders.terms(getEsFieldName()).field(getEsFieldName()+\".keyword\").size(size);\n MissingAggregationBuilder missingBuilder = AggregationBuilders.missing(\"missing_\" + getEsFieldName()).field(getEsFieldName()+\".keyword\");\n\n return Lists.newArrayList(termsBuilder, missingBuilder);\n }\n\n\n @Override\n public QueryBuilder buildFilter(final String key, final String... values) {\n return super.buildFilter(key + \".keyword\",values);\n }\n\n}\n","subject":"Fix for String MetaProps facet searches"} {"old_contents":"package com.example;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.boot.test.context.SpringBootTest.WebEnvironment;\nimport org.springframework.cloud.contract.wiremock.WireMockExpectations;\nimport org.springframework.test.annotation.DirtiesContext;\nimport org.springframework.test.context.junit4.SpringRunner;\nimport org.springframework.test.web.client.MockRestServiceServer;\nimport org.springframework.web.client.RestTemplate;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\n@DirtiesContext\n\/\/tag::wiremock_test[]\n@RunWith(SpringRunner.class)\n@SpringBootTest(webEnvironment=WebEnvironment.NONE)\npublic class WiremockForDocsMockServerApplicationTests {\n\n\t@Autowired\n\tprivate RestTemplate restTemplate;\n\n\t@Autowired\n\tprivate Service service;\n\n\t@Test\n\tpublic void contextLoads() throws Exception {\n\t\t\/\/ will read stubs from default \/resources\/stubs location\n\t\tMockRestServiceServer server = WireMockExpectations.with(this.restTemplate)\n\t\t\t\t.baseUrl(\"http:\/\/example.org\")\n\t\t\t\t.expect(\"resource\");\n\t\t\/\/ We're asserting if WireMock responded properly\n\t\tassertThat(this.service.go()).isEqualTo(\"Hello World\");\n\t\tserver.verify();\n\t}\n}\n\/\/end::wiremock_test[]\n","new_contents":"package com.example;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.boot.test.context.SpringBootTest.WebEnvironment;\nimport org.springframework.cloud.contract.wiremock.WireMockRestServiceServer;\nimport org.springframework.test.annotation.DirtiesContext;\nimport org.springframework.test.context.junit4.SpringRunner;\nimport org.springframework.test.web.client.MockRestServiceServer;\nimport org.springframework.web.client.RestTemplate;\n\n@DirtiesContext\n\/\/ tag::wiremock_test[]\n@RunWith(SpringRunner.class)\n@SpringBootTest(webEnvironment = WebEnvironment.NONE)\npublic class WiremockForDocsMockServerApplicationTests {\n\n\t@Autowired\n\tprivate RestTemplate restTemplate;\n\n\t@Autowired\n\tprivate Service service;\n\n\t@Test\n\tpublic void contextLoads() throws Exception {\n\t\t\/\/ will read stubs from default \/resources\/stubs location\n\t\tMockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate)\n\t\t\t\t.baseUrl(\"http:\/\/example.org\").stubs(\"resource\");\n\t\t\/\/ We're asserting if WireMock responded properly\n\t\tassertThat(this.service.go()).isEqualTo(\"Hello World\");\n\t\tserver.verify();\n\t}\n}\n\/\/ end::wiremock_test[]\n","subject":"Fix test that missed a re-factor"} {"old_contents":"package com.sample.hba;\n\nimport android.app.Activity;\nimport android.os.Bundle;\n\npublic class LauncherActivity extends Activity\n{\n \/** Called when the activity is first created. *\/\n @Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n }\n}\n","new_contents":"package com.sample.hba;\n\nimport android.app.Activity;\nimport android.os.Bundle;\n\npublic class LauncherActivity extends Activity\n{\n \/** Called when the activity is first created. *\/\n @Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n }\n\n \/** This method always returns true. *\/\n public boolean isRunningAtSnowMobileConf() {\n return true;\n }\n}\n","subject":"Add a sample method with some Javadoc."} {"old_contents":"package eu.scasefp7.eclipse.core.handlers;\r\n\r\nimport org.eclipse.core.commands.ExecutionEvent;\r\nimport org.eclipse.core.commands.ExecutionException;\r\n\r\n\/**\r\n * A command handler for exporting all service compositions to the linked ontology.\r\n * \r\n * @author themis\r\n *\/\r\npublic class CompileServiceCompositionsHandler extends CommandExecutorHandler {\r\n\r\n\t\/**\r\n\t * This function is called when the user selects the menu item. It populates the linked ontology.\r\n\t * \r\n\t * @param event the event containing the information about which file was selected.\r\n\t * @return the result of the execution which must be {@code null}.\r\n\t *\/\r\n\t@Override\r\n\tpublic Object execute(ExecutionEvent event) throws ExecutionException {\r\n\t\tif (getProjectOfExecutionEvent(event) != null) {\r\n\t\t\texecuteCommand(\"eu.scasefp7.eclipse.servicecomposition.commands.exportAllToOntology\");\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\tthrow new ExecutionException(\"No project selected\");\r\n\t\t}\r\n\t}\r\n\r\n}","new_contents":"package eu.scasefp7.eclipse.core.handlers;\r\n\r\nimport org.eclipse.core.commands.ExecutionEvent;\r\nimport org.eclipse.core.commands.ExecutionException;\r\n\r\n\/**\r\n * A command handler for exporting all service compositions to the linked ontology.\r\n * \r\n * @author themis\r\n *\/\r\npublic class CompileServiceCompositionsHandler extends CommandExecutorHandler {\r\n\r\n\t\/**\r\n\t * This function is called when the user selects the menu item. It populates the linked ontology.\r\n\t * \r\n\t * @param event the event containing the information about which file was selected.\r\n\t * @return the result of the execution which must be {@code null}.\r\n\t *\/\r\n\t@Override\r\n\tpublic Object execute(ExecutionEvent event) throws ExecutionException {\r\n\t\tif (getProjectOfExecutionEvent(event) != null) {\r\n\t\t\t\/\/ executeCommand(\"eu.scasefp7.eclipse.servicecomposition.commands.exportAllToOntology\");\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\tthrow new ExecutionException(\"No project selected\");\r\n\t\t}\r\n\t}\r\n\r\n}","subject":"Disable service composition plugin connection"} {"old_contents":"package org.bitsofinfo.hazelcast.discovery.docker.swarm;\n\nimport com.hazelcast.config.properties.PropertyDefinition;\nimport com.hazelcast.logging.ILogger;\nimport com.hazelcast.spi.discovery.DiscoveryNode;\nimport com.hazelcast.spi.discovery.DiscoveryStrategy;\nimport com.hazelcast.spi.discovery.DiscoveryStrategyFactory;\n\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.Map;\n\npublic class DockerSwarmDiscoveryStrategyFactory implements DiscoveryStrategyFactory {\n\n private static final Collection PROPERTIES =\n Arrays.asList(DockerSwarmDiscoveryConfiguration.DOCKER_SERVICE_LABELS,\n DockerSwarmDiscoveryConfiguration.DOCKER_NETWORK_NAMES,\n DockerSwarmDiscoveryConfiguration.DOCKER_SERVICE_NAMES,\n DockerSwarmDiscoveryConfiguration.HAZELCAST_PEER_PORT,\n DockerSwarmDiscoveryConfiguration.SWARM_MGR_URI,\n DockerSwarmDiscoveryConfiguration.SKIP_VERIFY_SSL,\n DockerSwarmDiscoveryConfiguration.LOG_ALL_SERVICE_NAMES_ON_FAILED_DISCOVERY);\n\n public Class getDiscoveryStrategyType() {\n \/\/ Returns the actual class type of the DiscoveryStrategy\n \/\/ implementation, to match it against the configuration\n return DockerSwarmDiscoveryStrategy.class;\n }\n\n public Collection getConfigurationProperties() {\n return PROPERTIES;\n }\n\n public DiscoveryStrategy newDiscoveryStrategy(DiscoveryNode discoveryNode,\n ILogger logger,\n Map properties) {\n\n return new DockerSwarmDiscoveryStrategy(discoveryNode, logger, properties);\n }\n\n}\n","new_contents":"package org.bitsofinfo.hazelcast.discovery.docker.swarm;\n\nimport com.hazelcast.config.properties.PropertyDefinition;\nimport com.hazelcast.logging.ILogger;\nimport com.hazelcast.spi.discovery.DiscoveryNode;\nimport com.hazelcast.spi.discovery.DiscoveryStrategy;\nimport com.hazelcast.spi.discovery.DiscoveryStrategyFactory;\n\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.Map;\n\npublic class DockerSwarmDiscoveryStrategyFactory implements DiscoveryStrategyFactory {\n\n private static final Collection PROPERTIES =\n Arrays.asList(DockerSwarmDiscoveryConfiguration.DOCKER_SERVICE_LABELS,\n DockerSwarmDiscoveryConfiguration.DOCKER_NETWORK_NAMES,\n DockerSwarmDiscoveryConfiguration.DOCKER_SERVICE_NAMES,\n DockerSwarmDiscoveryConfiguration.HAZELCAST_PEER_PORT,\n DockerSwarmDiscoveryConfiguration.SWARM_MGR_URI,\n DockerSwarmDiscoveryConfiguration.SKIP_VERIFY_SSL,\n DockerSwarmDiscoveryConfiguration.LOG_ALL_SERVICE_NAMES_ON_FAILED_DISCOVERY,\n DockerSwarmDiscoveryConfiguration.STRICT_DOCKER_SERVICE_NAME_COMPARISON);\n\n public Class getDiscoveryStrategyType() {\n \/\/ Returns the actual class type of the DiscoveryStrategy\n \/\/ implementation, to match it against the configuration\n return DockerSwarmDiscoveryStrategy.class;\n }\n\n public Collection getConfigurationProperties() {\n return PROPERTIES;\n }\n\n public DiscoveryStrategy newDiscoveryStrategy(DiscoveryNode discoveryNode,\n ILogger logger,\n Map properties) {\n\n return new DockerSwarmDiscoveryStrategy(discoveryNode, logger, properties);\n }\n\n}\n","subject":"Add STRICT_DOCKER_SERVICE_NAME_COMPARISON to Collection of PropertyDefinition"} {"old_contents":"package com.testdroid.appium.ios.sample;\n\nimport org.testng.annotations.AfterClass;\nimport org.testng.annotations.BeforeClass;\nimport org.testng.annotations.Test;\nimport org.openqa.selenium.By;\nimport org.openqa.selenium.WebElement;\nimport com.testdroid.appium.BaseIOSTest;\n\nimport java.util.concurrent.TimeUnit;\n\npublic class IosAppiumExampleTest extends BaseIOSTest {\n \n @BeforeClass\n public void setUp() throws Exception {\n setUpTest();\n }\n @AfterClass\n public void tearDown()\n {\n quitAppiumSession();\n }\n\n @Test\n public void mainPageTest() throws Exception {\n wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n wd.findElement(By.name(\"answer1\")).click();\n WebElement element = wd.findElement(By.name(\"userName\"));\n takeScreenshot(\"example_screenshot\");\n element.click();\n element.sendKeys(\"Testdroid\");\n wd.findElement(By.name(\"Return\")).click();\n wd.findElement(By.name(\"sendAnswer\")).click();\n }\n\n\n}\n","new_contents":"package com.testdroid.appium.ios.sample;\n\nimport org.testng.annotations.AfterClass;\nimport org.testng.annotations.BeforeClass;\nimport org.testng.annotations.Test;\nimport org.openqa.selenium.By;\nimport org.openqa.selenium.WebElement;\nimport com.testdroid.appium.BaseIOSTest;\n\nimport java.util.concurrent.TimeUnit;\n\npublic class IosAppiumExampleTest extends BaseIOSTest {\n\n @BeforeClass\n public void setUp() throws Exception {\n setUpTest();\n }\n @AfterClass\n public void tearDown()\n {\n quitAppiumSession();\n }\n\n @Test\n public void mainPageTest() throws Exception {\n wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n wd.findElement(By.xpath(\"\/\/*[contains(@name, 'answer1')]\")).click();\n WebElement element = wd.findElement(By.xpath(\"\/\/*[contains(@name, 'userName')]\"));\n takeScreenshot(\"example_screenshot\");\n element.click();\n element.sendKeys(\"Testdroid\");\n wd.findElement(By.xpath(\"\/\/*[contains(@name, 'Return')]\")).click();\n wd.findElement(By.xpath(\"\/\/*[contains(@name, 'sendAnswer')]\")).click();\n }\n\n\n}\n","subject":"Replace deprecated By.name locators with By.xpath"} {"old_contents":"package com.github.sherter.googlejavaformatgradleplugin.format;\n\nimport com.google.common.collect.ImmutableList;\n\n\/** Static factory method for creating new {@link Formatter}s. *\/\npublic class Gjf {\n\n public static final String GROUP_ID = \"com.google.googlejavaformat\";\n public static final String ARTIFACT_ID = \"google-java-format\";\n\n public static final ImmutableList SUPPORTED_VERSIONS =\n ImmutableList.of(\"1.0\", \"1.1\", \"1.2\", \"1.3\", \"1.4\", \"1.5\", \"1.6\");\n\n \/**\n * Constructs a new formatter that delegates to google-java-format<\/a>.\n *\n * @param classLoader load {@code google-java-format} classes from this {@code ClassLoader}\n * @param config configure the formatter according to this configuration\n * @throws ReflectiveOperationException if the requested {@code Formatter} cannot be constructed\n *\/\n public static Formatter newFormatter(ClassLoader classLoader, Configuration config)\n throws ReflectiveOperationException {\n return newFormatterFactory(classLoader, config).create();\n }\n\n private static FormatterFactory newFormatterFactory(\n ClassLoader classLoader, Configuration config) {\n switch (config.version) {\n case \"1.0\":\n return new OneDotZeroFactory(classLoader, config);\n case \"1.1\":\n return new OneDotOneFactory(classLoader, config);\n default:\n return new OneDotOneFactory(classLoader, config);\n }\n }\n}\n","new_contents":"package com.github.sherter.googlejavaformatgradleplugin.format;\n\nimport com.google.common.collect.ImmutableList;\n\n\/** Static factory method for creating new {@link Formatter}s. *\/\npublic class Gjf {\n\n public static final String GROUP_ID = \"com.google.googlejavaformat\";\n public static final String ARTIFACT_ID = \"google-java-format\";\n\n public static final ImmutableList SUPPORTED_VERSIONS =\n ImmutableList.of(\"1.0\", \"1.1\", \"1.2\", \"1.3\", \"1.4\", \"1.5\", \"1.6\", \"1.7\");\n\n \/**\n * Constructs a new formatter that delegates to google-java-format<\/a>.\n *\n * @param classLoader load {@code google-java-format} classes from this {@code ClassLoader}\n * @param config configure the formatter according to this configuration\n * @throws ReflectiveOperationException if the requested {@code Formatter} cannot be constructed\n *\/\n public static Formatter newFormatter(ClassLoader classLoader, Configuration config)\n throws ReflectiveOperationException {\n return newFormatterFactory(classLoader, config).create();\n }\n\n private static FormatterFactory newFormatterFactory(\n ClassLoader classLoader, Configuration config) {\n switch (config.version) {\n case \"1.0\":\n return new OneDotZeroFactory(classLoader, config);\n case \"1.1\":\n return new OneDotOneFactory(classLoader, config);\n default:\n return new OneDotOneFactory(classLoader, config);\n }\n }\n}\n","subject":"Add last version of Google Java Format to supported versions"} {"old_contents":"package org.gozer.services;\n\nimport org.eclipse.jgit.api.Git;\nimport org.eclipse.jgit.api.errors.GitAPIException;\nimport org.eclipse.jgit.lib.Repository;\nimport org.eclipse.jgit.storage.file.FileRepository;\n\nimport java.io.File;\nimport java.io.IOException;\n\npublic class GitService {\n\n public void cloneRepository() throws IOException, GitAPIException {\n\n String localPath = \"target\/git\";\n String remotePath = \"https:\/\/github.com\/GozerProject\/gozer.git\";\n FileRepository localRepo = new FileRepository(localPath + \"\/.git\");\n Git git = new Git(localRepo);\n\n Repository newRepo = new FileRepository(localPath + \".git\");\n newRepo.create();\n\n Git.cloneRepository()\n .setURI(remotePath)\n .setDirectory(new File(localPath))\n .call();\n }\n\n public static void main(String[] args) throws IOException, GitAPIException {\n GitService gitService = new GitService();\n gitService.cloneRepository();\n }\n}\n","new_contents":"package org.gozer.services;\n\nimport org.eclipse.jgit.api.Git;\nimport org.eclipse.jgit.api.errors.GitAPIException;\nimport org.eclipse.jgit.lib.Repository;\nimport org.eclipse.jgit.storage.file.FileRepository;\n\nimport java.io.File;\nimport java.io.IOException;\n\npublic class GitService {\n\n public void cloneRepository() throws IOException, GitAPIException {\n\n String localPath = \"target\/git\/spring-pet-clinic\";\n String remotePath = \"https:\/\/github.com\/SpringSource\/spring-petclinic.git\";\n FileRepository localRepo = new FileRepository(localPath + \"\/.git\");\n Git git = new Git(localRepo);\n\n\n \/\/ TODO sert à quelque chose dans le cas d'un clone ?\n Repository newRepo = new FileRepository(localPath + \"\/.git\");\n newRepo.create();\n\n Git.cloneRepository()\n .setURI(remotePath)\n .setDirectory(new File(localPath))\n .call();\n }\n\n public static void main(String[] args) throws IOException, GitAPIException {\n GitService gitService = new GitService();\n gitService.cloneRepository();\n }\n}\n","subject":"Clone the spring-pet-clinic to test"} {"old_contents":"\/*\n * Copyright DataStax, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.datastax.oss.driver.api.testinfra.ccm;\n\nimport com.datastax.oss.driver.api.core.Version;\n\npublic class DefaultCcmBridgeBuilderCustomizer {\n\n public static CcmBridge.Builder configureBuilder(CcmBridge.Builder builder) {\n if (!CcmBridge.DSE_ENABLEMENT && CcmBridge.VERSION.compareTo(Version.V4_0_0) >= 0) {\n builder.withCassandraConfiguration(\"enable_materialized_views\", true);\n }\n return builder;\n }\n}\n","new_contents":"\/*\n * Copyright DataStax, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.datastax.oss.driver.api.testinfra.ccm;\n\nimport com.datastax.oss.driver.api.core.Version;\n\npublic class DefaultCcmBridgeBuilderCustomizer {\n\n public static CcmBridge.Builder configureBuilder(CcmBridge.Builder builder) {\n if (!CcmBridge.DSE_ENABLEMENT\n && CcmBridge.VERSION.nextStable().compareTo(Version.V4_0_0) >= 0) {\n builder.withCassandraConfiguration(\"enable_materialized_views\", true);\n builder.withCassandraConfiguration(\"enable_sasi_indexes\", true);\n }\n return builder;\n }\n}\n","subject":"Enable SASI indexes when running mapper tests against C* 4"} {"old_contents":"package common;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.EnableAutoConfiguration;\nimport org.springframework.context.annotation.ComponentScan;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\n@EnableAutoConfiguration\n@ComponentScan\npublic class AppConfig {\n\n public static void main(String[] args) {\n SpringApplication.run(AppConfig.class, args);\n }\n}","new_contents":"package com.routeme;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication\npublic class AppConfig {\n\n public static void main(String[] args) {\n SpringApplication.run(AppConfig.class, args);\n }\n}","subject":"Simplify annotations with the all inclusive @SprintBootApplication"} {"old_contents":"\/**\n * Copyright (C) 2014 android10.org. All rights reserved.\n * @author Fernando Cejas (the android10 coder)\n *\/\npackage com.fernandocejas.android10.sample.presentation.view.activity;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.view.Window;\nimport com.fernandocejas.android10.sample.presentation.R;\nimport com.fernandocejas.android10.sample.presentation.model.UserModel;\nimport com.fernandocejas.android10.sample.presentation.navigation.Navigator;\nimport com.fernandocejas.android10.sample.presentation.view.fragment.UserListFragment;\n\n\/**\n * Activity that shows a list of Users.\n *\/\npublic class UserListActivity extends BaseActivity implements UserListFragment.UserListListener {\n\n public static Intent getCallingIntent(Context context) {\n return new Intent(context, UserListActivity.class);\n }\n\n @Override protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);\n setContentView(R.layout.activity_user_list);\n\n this.initialize();\n }\n\n @Override public void onUserClicked(UserModel userModel) {\n this.navigator.navigateToUserDetails(this, userModel.getUserId());\n }\n\n \/**\n * Initializes activity's private members.\n *\/\n private void initialize() {\n \/\/This initialization should be avoided by using a dependency injection framework.\n \/\/But this is an example and for testing purpose.\n this.navigator = new Navigator();\n }\n}\n","new_contents":"\/**\n * Copyright (C) 2014 android10.org. All rights reserved.\n * @author Fernando Cejas (the android10 coder)\n *\/\npackage com.fernandocejas.android10.sample.presentation.view.activity;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.view.Window;\nimport com.fernandocejas.android10.sample.presentation.R;\nimport com.fernandocejas.android10.sample.presentation.model.UserModel;\nimport com.fernandocejas.android10.sample.presentation.view.fragment.UserListFragment;\n\n\/**\n * Activity that shows a list of Users.\n *\/\npublic class UserListActivity extends BaseActivity implements UserListFragment.UserListListener {\n\n public static Intent getCallingIntent(Context context) {\n return new Intent(context, UserListActivity.class);\n }\n\n @Override protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);\n setContentView(R.layout.activity_user_list);\n }\n\n @Override public void onUserClicked(UserModel userModel) {\n this.navigator.navigateToUserDetails(this, userModel.getUserId());\n }\n}\n","subject":"Remove unused initialization code from user list activity."} {"old_contents":"package com.grayben.riskExtractor.htmlScorer.scorers.elementScorers;\n\nimport com.grayben.riskExtractor.htmlScorer.scorers.Scorer;\nimport com.grayben.riskExtractor.htmlScorer.scorers.ScorerTest;\nimport org.jsoup.nodes.Element;\nimport org.jsoup.parser.Tag;\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.rules.ExpectedException;\nimport org.junit.runner.RunWith;\nimport org.mockito.Mock;\nimport org.mockito.runners.MockitoJUnitRunner;\n\n\/**\n * Created by beng on 28\/11\/2015.\n *\/\n@RunWith(MockitoJUnitRunner.class)\npublic class SegmentationElementScorerTest\n implements ScorerTest {\n\n SegmentationElementScorer elementScorerSUT;\n @Mock\n Scorer tagScorerMock;\n @Mock\n Element elementMock;\n\n @Rule\n ExpectedException thrown = ExpectedException.none();\n\n @Before\n public void setUp() throws Exception {\n elementScorerSUT = new SegmentationElementScorer(tagScorerMock);\n }\n\n @After\n public void tearDown() throws Exception {\n elementScorerSUT = null;\n }\n\n}","new_contents":"package com.grayben.riskExtractor.htmlScorer.scorers.elementScorers;\n\nimport com.grayben.riskExtractor.htmlScorer.scorers.Scorer;\nimport com.grayben.riskExtractor.htmlScorer.scorers.ScorerTest;\nimport org.jsoup.nodes.Element;\nimport org.jsoup.parser.Tag;\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.runner.RunWith;\nimport org.mockito.Mock;\nimport org.mockito.runners.MockitoJUnitRunner;\n\n\/**\n * Created by beng on 28\/11\/2015.\n *\/\n@RunWith(MockitoJUnitRunner.class)\npublic class SegmentationElementScorerTest\n extends ScorerTest {\n\n SegmentationElementScorer elementScorerSUT;\n @Mock\n Scorer tagScorerMock;\n @Mock\n Element elementMock;\n\n @Before\n public void setUp() throws Exception {\n elementScorerSUT = new SegmentationElementScorer(tagScorerMock);\n super.setUp(elementScorerSUT);\n }\n\n @After\n public void tearDown() throws Exception {\n elementScorerSUT = null;\n }\n\n}","subject":"Align test with new base class"} {"old_contents":"package com.peterphi.std.guice.web.rest.templating.thymeleaf;\n\nimport com.google.inject.Provider;\nimport com.peterphi.std.guice.common.auth.iface.CurrentUser;\nimport org.joda.time.DateTime;\n\nimport java.time.Instant;\nimport java.util.Date;\n\npublic class ThymeleafCurrentUserUtils\n{\n\tprivate final Provider provider;\n\n\n\tpublic ThymeleafCurrentUserUtils(final Provider provider)\n\t{\n\t\tthis.provider = provider;\n\t}\n\n\n\tpublic boolean hasRole(String role)\n\t{\n\t\treturn getUser().hasRole(role);\n\t}\n\n\n\tpublic String getAuthType()\n\t{\n\t\treturn getUser().getAuthType();\n\t}\n\n\n\tpublic CurrentUser getUser()\n\t{\n\t\treturn provider.get();\n\t}\n\n\n\tpublic boolean isAnonymous()\n\t{\n\t\treturn getUser().isAnonymous();\n\t}\n\n\n\tpublic String format(DateTime date)\n\t{\n\t\treturn getUser().format(date);\n\t}\n\n\n\tpublic String format(Date date)\n\t{\n\t\treturn getUser().format(date);\n\t}\n\n\n\tpublic String format(Instant date)\n\t{\n\t\treturn getUser().format(date);\n\t}\n\n\n\tpublic String format(Long date)\n\t{\n\t\tif (date == null)\n\t\t\treturn format((DateTime) null);\n\t\telse\n\t\t\treturn format(new DateTime(date));\n\t}\n}\n","new_contents":"package com.peterphi.std.guice.web.rest.templating.thymeleaf;\n\nimport com.google.inject.Provider;\nimport com.peterphi.std.guice.common.auth.iface.CurrentUser;\nimport org.joda.time.DateTime;\n\nimport java.time.Instant;\nimport java.util.Date;\n\npublic class ThymeleafCurrentUserUtils\n{\n\tprivate final Provider provider;\n\n\n\tpublic ThymeleafCurrentUserUtils(final Provider provider)\n\t{\n\t\tthis.provider = provider;\n\t}\n\n\n\tpublic boolean hasRole(String role)\n\t{\n\t\treturn getUser().hasRole(role);\n\t}\n\n\n\tpublic String getAuthType()\n\t{\n\t\treturn getUser().getAuthType();\n\t}\n\n\n\tpublic CurrentUser getUser()\n\t{\n\t\treturn provider.get();\n\t}\n\n\n\tpublic String getName()\n\t{\n\t\treturn getUser().getName();\n\t}\n\n\n\tpublic String getUsername()\n\t{\n\t\treturn getUser().getUsername();\n\t}\n\n\n\tpublic DateTime getExpires()\n\t{\n\t\treturn getUser().getExpires();\n\t}\n\n\n\tpublic boolean isAnonymous()\n\t{\n\t\treturn getUser().isAnonymous();\n\t}\n\n\n\tpublic String format(DateTime date)\n\t{\n\t\treturn getUser().format(date);\n\t}\n\n\n\tpublic String format(Date date)\n\t{\n\t\treturn getUser().format(date);\n\t}\n\n\n\tpublic String format(Instant date)\n\t{\n\t\treturn getUser().format(date);\n\t}\n\n\n\tpublic String format(Long date)\n\t{\n\t\tif (date == null)\n\t\t\treturn format((DateTime) null);\n\t\telse\n\t\t\treturn format(new DateTime(date));\n\t}\n}\n","subject":"Allow currentUser.username, etc. from within templates (rather than currentUser.user.username)"} {"old_contents":"\/*\n * Copyright 2011 JBoss Inc\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.drools.guvnor.client.widgets.decoratedgrid;\n\n\/**\n * Class to calculate the height of a cell in a VerticalMergedGrid for Mozilla.\n *\/\npublic class CellHeightCalculatorImplMozilla extends CellHeightCalculatorImpl {\n\n public int calculateHeight(int rowSpan) {\n int divHeight = (style.rowHeight() - style.borderWidth()) * rowSpan;\n return divHeight;\n }\n\n}\n","new_contents":"\/*\n * Copyright 2011 JBoss Inc\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.drools.guvnor.client.widgets.decoratedgrid;\n\n\/**\n * Class to calculate the height of a cell in a VerticalMergedGrid for Mozilla.\n *\/\npublic class CellHeightCalculatorImplMozilla extends CellHeightCalculatorImpl {\n\n public int calculateHeight(int rowSpan) {\n int divHeight = (style.rowHeight()) * rowSpan - style.borderWidth();\n return divHeight;\n }\n\n}\n","subject":"Fix cosmetic issue on FF"} {"old_contents":"package org.gradle.sample.plugin;\n\nimport javax.inject.Inject;\nimport org.gradle.api.Plugin;\nimport org.gradle.api.Project;\nimport org.gradle.tooling.provider.model.ToolingModelBuilder;\nimport org.gradle.tooling.provider.model.ToolingModelBuilderRegistry;\n\n\/**\n * A plugin that exposes a custom tooling model.\n *\/\npublic class CustomPlugin implements Plugin {\n private final ToolingModelBuilderRegistry registry;\n\n \/**\n * Need to use a {@link ToolingModelBuilderRegistry} to register the custom tooling model, so inject this into\n * the constructor.\n *\/\n @Inject\n public CustomPlugin(ToolingModelBuilderRegistry registry) {\n this.registry = registry;\n }\n\n public void apply(Project project) {\n \/\/ Register a builder for the custom tooling model\n registry.register(new CustomToolingModelBuilder());\n }\n\n private static class CustomToolingModelBuilder extends ToolingModelBuilder {\n public boolean canBuild(String modelName) {\n \/\/ The default name for a model is the name of the Java interface\n return modelName.equals(CustomModel.class.getName());\n }\n\n public Object buildAll(String modelName, Project project) {\n return new DefaultModel();\n }\n }\n}\n","new_contents":"package org.gradle.sample.plugin;\n\nimport javax.inject.Inject;\nimport org.gradle.api.Plugin;\nimport org.gradle.api.Project;\nimport org.gradle.tooling.provider.model.ToolingModelBuilder;\nimport org.gradle.tooling.provider.model.ToolingModelBuilderRegistry;\n\n\/**\n * A plugin that exposes a custom tooling model.\n *\/\npublic class CustomPlugin implements Plugin {\n private final ToolingModelBuilderRegistry registry;\n\n \/**\n * Need to use a {@link ToolingModelBuilderRegistry} to register the custom tooling model, so inject this into\n * the constructor.\n *\/\n @Inject\n public CustomPlugin(ToolingModelBuilderRegistry registry) {\n this.registry = registry;\n }\n\n public void apply(Project project) {\n \/\/ Register a builder for the custom tooling model\n registry.register(new CustomToolingModelBuilder());\n }\n\n private static class CustomToolingModelBuilder implements ToolingModelBuilder {\n public boolean canBuild(String modelName) {\n \/\/ The default name for a model is the name of the Java interface\n return modelName.equals(CustomModel.class.getName());\n }\n\n public Object buildAll(String modelName, Project project) {\n return new DefaultModel();\n }\n }\n}\n","subject":"Fix sample for custom tooling model: ToolingModelBuilder is an interface."} {"old_contents":"\/**\n * Copyright (c) 2010 RedEngine Ltd, http:\/\/www.redengine.co.nz. All rights reserved.\n *\n * This program is licensed to you under the Apache License Version 2.0,\n * and you may not use this file except in compliance with the Apache License Version 2.0.\n * You may obtain a copy of the Apache License Version 2.0 at http:\/\/www.apache.org\/licenses\/LICENSE-2.0.\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the Apache License Version 2.0 is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.\n *\/\npackage net.stickycode.mockwire.guice2;\n\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Suite;\nimport org.junit.runners.Suite.SuiteClasses;\n\nimport net.stickycode.mockwire.MockwireTck;\nimport net.stickycode.mockwire.direct.MockwireDirectTck;\nimport net.stickycode.mockwire.junit4.MockwireRunnerTck;\n\n@RunWith(Suite.class)\n@SuiteClasses({\n MockwireTck.class,\n MockwireDirectTck.class,\n MockwireRunnerTck.class\n})\npublic class MockwireTckTest {\n\n}\n","new_contents":"\/**\n * Copyright (c) 2010 RedEngine Ltd, http:\/\/www.redengine.co.nz. All rights reserved.\n *\n * This program is licensed to you under the Apache License Version 2.0,\n * and you may not use this file except in compliance with the Apache License Version 2.0.\n * You may obtain a copy of the Apache License Version 2.0 at http:\/\/www.apache.org\/licenses\/LICENSE-2.0.\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the Apache License Version 2.0 is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.\n *\/\npackage net.stickycode.mockwire.guice2;\n\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Suite;\nimport org.junit.runners.Suite.SuiteClasses;\n\nimport net.stickycode.mockwire.FieldBlessingTest;\nimport net.stickycode.mockwire.FieldMockingTest;\nimport net.stickycode.mockwire.UnblessableTypesTest;\n\n@RunWith(Suite.class)\n@SuiteClasses({\n FieldBlessingTest.class,\n FieldMockingTest.class,\n UnblessableTypesTest.class })\npublic class MockwireTckTest {\n\n \/**\n * This is an anchor for Infinitest to rerun this suite if its changes\n *\/\n GuiceIsolatedTestManifest anchor;\n\n}\n","subject":"Cut down version of the full test suite pending scanning and configured support"} {"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.apache.camel.component.elasticsearch;\n\nimport org.apache.camel.builder.RouteBuilder;\nimport org.elasticsearch.action.main.MainResponse;\nimport org.junit.Test;\n\npublic class ElasticsearchInfoTest extends ElasticsearchBaseTest {\n\n @Test\n public void testInfo() throws Exception {\n MainResponse infoResult = template.requestBody(\"direct:info\", \"test\", MainResponse.class);\n assertNotNull(infoResult.getClusterName());\n assertNotNull(infoResult.getNodeName());\n }\n\n @Override\n protected RouteBuilder createRouteBuilder() throws Exception {\n return new RouteBuilder() {\n @Override\n public void configure() {\n from(\"direct:info\").to(\"elasticsearch-rest:\/\/elasticsearch?operation=Info&hostAddresses=localhost:\" + ES_BASE_HTTP_PORT);\n }\n };\n }\n}\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.apache.camel.component.elasticsearch;\n\nimport org.apache.camel.builder.RouteBuilder;\nimport org.elasticsearch.client.core.MainResponse;\nimport org.junit.Test;\n\npublic class ElasticsearchInfoTest extends ElasticsearchBaseTest {\n\n @Test\n public void testInfo() throws Exception {\n MainResponse infoResult = template.requestBody(\"direct:info\", \"test\", MainResponse.class);\n assertNotNull(infoResult.getClusterName());\n assertNotNull(infoResult.getNodeName());\n }\n\n @Override\n protected RouteBuilder createRouteBuilder() throws Exception {\n return new RouteBuilder() {\n @Override\n public void configure() {\n from(\"direct:info\").to(\"elasticsearch-rest:\/\/elasticsearch?operation=Info&hostAddresses=localhost:\" + ES_BASE_HTTP_PORT);\n }\n };\n }\n}\n","subject":"Revert \"Revert \"Fixed ElasticSearchInfoTest after upgrading to 7.3.1\"\""} {"old_contents":"package name.webdizz.fault.tolerance.inventory.client.command;\n\nimport name.webdizz.fault.tolerance.inventory.client.InventoryRequester;\nimport name.webdizz.fault.tolerance.inventory.domain.Inventory;\nimport name.webdizz.fault.tolerance.inventory.domain.Product;\nimport name.webdizz.fault.tolerance.inventory.domain.Store;\n\nimport com.netflix.hystrix.HystrixCommand;\nimport com.netflix.hystrix.HystrixCommandGroupKey;\nimport com.netflix.hystrix.HystrixCommandKey;\nimport com.netflix.hystrix.HystrixCommandProperties;\n\npublic class TimeOutInventoryRequestCommand extends HystrixCommand {\n\n private final InventoryRequester inventoryRequester;\n private final Store store;\n private final Product product;\n\n public TimeOutInventoryRequestCommand(final int timeoutInMillis, final InventoryRequester inventoryRequester, final Store store, final Product product) {\n super(Setter\n .withGroupKey(HystrixCommandGroupKey.Factory.asKey(\"InventoryRequest\"))\n .andCommandKey(HystrixCommandKey.Factory.asKey(TimeOutInventoryRequestCommand.class.getSimpleName()))\n .andCommandPropertiesDefaults(HystrixCommandProperties.Setter()\n .withCircuitBreakerForceClosed(true)\n .withExecutionTimeoutInMilliseconds(timeoutInMillis))\n );\n this.inventoryRequester = inventoryRequester;\n this.store = store;\n this.product = product;\n }\n\n @Override\n protected Inventory run() throws Exception {\n return inventoryRequester.requestInventoryFor(store, product);\n }\n}\n","new_contents":"package name.webdizz.fault.tolerance.inventory.client.command;\n\nimport name.webdizz.fault.tolerance.inventory.client.InventoryRequester;\nimport name.webdizz.fault.tolerance.inventory.domain.Inventory;\nimport name.webdizz.fault.tolerance.inventory.domain.Product;\nimport name.webdizz.fault.tolerance.inventory.domain.Store;\n\nimport com.netflix.hystrix.HystrixCommand;\nimport com.netflix.hystrix.HystrixCommandGroupKey;\nimport com.netflix.hystrix.HystrixCommandKey;\nimport com.netflix.hystrix.HystrixCommandProperties;\n\npublic class TimeOutInventoryRequestCommand extends HystrixCommand {\n\n private final InventoryRequester inventoryRequester;\n private final Store store;\n private final Product product;\n\n public TimeOutInventoryRequestCommand(final int timeoutInMillis, final InventoryRequester inventoryRequester, final Store store, final Product product) {\n super(Setter\n .withGroupKey(HystrixCommandGroupKey.Factory.asKey(TimeOutInventoryRequestCommand.class.getSimpleName()))\n .andCommandKey(HystrixCommandKey.Factory.asKey(TimeOutInventoryRequestCommand.class.getSimpleName()))\n .andCommandPropertiesDefaults(HystrixCommandProperties.Setter()\n .withCircuitBreakerForceClosed(true)\n .withExecutionTimeoutInMilliseconds(timeoutInMillis))\n );\n this.inventoryRequester = inventoryRequester;\n this.store = store;\n this.product = product;\n }\n\n @Override\n protected Inventory run() throws Exception {\n return inventoryRequester.requestInventoryFor(store, product);\n }\n}\n","subject":"Set Hystrix group key to command class name"} {"old_contents":"package com.codenvy.ide.ext.datasource.client.sqllauncher;\n\npublic interface SqlRequestLauncherFactory {\n\n SqlRequestLauncherView createSqlRequestLauncherView();\n\n SqlRequestLauncherPresenter createSqlRequestLauncherPresenter();\n\n SqlRequestLauncherAdapter createSqlRequestLauncherAdapter();\n}\n","new_contents":"package com.codenvy.ide.ext.datasource.client.sqllauncher;\n\npublic interface SqlRequestLauncherFactory {\n\n SqlRequestLauncherView createSqlRequestLauncherView();\n\n SqlRequestLauncherPresenter createSqlRequestLauncherPresenter();\n\n}\n","subject":"Remove launcher view factory method"} {"old_contents":"\/*\n * Copyright (c) 2016 EMC Corporation. All Rights Reserved.\n *\/\npackage com.emc.ia.sdk.support.io;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.function.Supplier;\n\nimport org.apache.commons.io.IOUtils;\n\n\n\/**\n * Provide repeatable access to the same {@linkplain InputStream} by caching it in memory.\n *\/\npublic class RepeatableInputStream implements Supplier {\n\n private final ByteArrayInputOutputStream provider = new ByteArrayInputOutputStream();\n\n \/**\n * Provide repeatable access to the given input stream.\n * @param source The input stream to make available for repeated access\n * @throws IOException When an I\/O error occurs\n *\/\n public RepeatableInputStream(InputStream source) throws IOException {\n IOUtils.copy(source, provider);\n }\n\n @Override\n public InputStream get() {\n return provider.getInputStream();\n }\n\n}\n","new_contents":"\/*\n * Copyright (c) 2016 EMC Corporation. All Rights Reserved.\n *\/\npackage com.emc.ia.sdk.support.io;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Objects;\nimport java.util.function.Supplier;\n\nimport org.apache.commons.io.IOUtils;\n\n\n\/**\n * Provide repeatable access to the same {@linkplain InputStream} by caching it in memory.\n *\/\npublic class RepeatableInputStream implements Supplier {\n\n private final ByteArrayInputOutputStream provider = new ByteArrayInputOutputStream();\n\n \/**\n * Provide repeatable access to the given input stream.\n * @param source The input stream to make available for repeated access. Must not be null<\/code>\n * @throws IOException When an I\/O error occurs\n *\/\n public RepeatableInputStream(InputStream source) throws IOException {\n IOUtils.copy(Objects.requireNonNull(source), provider);\n }\n\n @Override\n public InputStream get() {\n return provider.getInputStream();\n }\n\n}\n","subject":"Add check for null parameter"} {"old_contents":"\/*\n * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.traccar;\n\nimport org.traccar.helper.Log;\nimport org.traccar.model.Position;\n\npublic class DefaultDataHandler extends BaseDataHandler {\n\n @Override\n protected Position handlePosition(Position position) {\n\n try {\n Context.getDataManager().addPosition(position);\n Position lastPosition = Context.getConnectionManager().getLastPosition(position.getDeviceId());\n if (position.getFixTime().compareTo(lastPosition.getFixTime()) > 0) {\n Context.getDataManager().updateLatestPosition(position);\n }\n } catch (Exception error) {\n Log.warning(error);\n }\n\n return position;\n }\n\n}\n","new_contents":"\/*\n * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.traccar;\n\nimport org.traccar.helper.Log;\nimport org.traccar.model.Position;\n\npublic class DefaultDataHandler extends BaseDataHandler {\n\n @Override\n protected Position handlePosition(Position position) {\n\n try {\n Context.getDataManager().addPosition(position);\n Position lastPosition = Context.getConnectionManager().getLastPosition(position.getDeviceId());\n if (lastPosition == null || position.getFixTime().compareTo(lastPosition.getFixTime()) > 0) {\n Context.getDataManager().updateLatestPosition(position);\n }\n } catch (Exception error) {\n Log.warning(error);\n }\n\n return position;\n }\n\n}\n","subject":"Fix data handler first position crash"} {"old_contents":"\/*\n * Copyright 2013-2014 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.springframework.cloud.aws.autoconfigure.cache;\n\nimport org.springframework.cloud.aws.autoconfigure.context.ContextCredentialsProviderAutoConfiguration;\nimport org.springframework.cloud.aws.cache.config.annotation.EnableElastiCache;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\n\n\/**\n * @author Agim Emruli\n *\/\n@Configuration\n@Import(ContextCredentialsProviderAutoConfiguration.class)\n@EnableElastiCache\npublic class ElastiCacheAutoConfiguration {\n}","new_contents":"\/*\n * Copyright 2013-2014 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.springframework.cloud.aws.autoconfigure.cache;\n\nimport net.spy.memcached.MemcachedClient;\nimport org.springframework.boot.autoconfigure.condition.ConditionalOnClass;\nimport org.springframework.cloud.aws.autoconfigure.context.ContextCredentialsProviderAutoConfiguration;\nimport org.springframework.cloud.aws.cache.config.annotation.EnableElastiCache;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\n\n\/**\n * @author Agim Emruli\n *\/\n@Configuration\n@Import(ContextCredentialsProviderAutoConfiguration.class)\n@EnableElastiCache\n@ConditionalOnClass(value = MemcachedClient.class)\npublic class ElastiCacheAutoConfiguration {\n}","subject":"Add condition on memcached class to ensure that there is a client available before running this autoconfig class"} {"old_contents":"package nu.studer.teamcity.buildscan.agent.servicemessage;\n\nfinal class ServiceMessage {\n\n private static final String SERVICE_MESSAGE_START = \"##teamcity[\";\n private static final String SERVICE_MESSAGE_END = \"]\";\n\n private final String name;\n private final String argument;\n\n private ServiceMessage(String name, String argument) {\n this.name = name;\n this.argument = argument;\n }\n\n static ServiceMessage of(String name, String argument) {\n return new ServiceMessage(name, argument);\n }\n\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(SERVICE_MESSAGE_START);\n sb.append(name);\n sb.append(' ');\n sb.append('\\'');\n sb.append(escape(argument));\n sb.append('\\'');\n sb.append(SERVICE_MESSAGE_END);\n return sb.toString();\n }\n\n private String escape(String s) {\n StringBuilder sb = new StringBuilder();\n for (char c : s.toCharArray()) {\n sb.append(escape(c));\n }\n return sb.toString();\n }\n\n private String escape(final char c) {\n switch (c) {\n case '\\n':\n return \"n\";\n case '\\r':\n return \"r\";\n case '|':\n return \"|\";\n case '\\'':\n return \"\\'\";\n case '[':\n return \"[\";\n case ']':\n return \"]\";\n default:\n return c < 128 ? Character.toString(c) : String.format(\"0x%04x\", (int) c);\n }\n }\n\n}\n","new_contents":"package nu.studer.teamcity.buildscan.agent.servicemessage;\n\nfinal class ServiceMessage {\n\n private static final String SERVICE_MESSAGE_START = \"##teamcity[\";\n private static final String SERVICE_MESSAGE_END = \"]\";\n\n private final String name;\n private final String argument;\n\n private ServiceMessage(String name, String argument) {\n this.name = name;\n this.argument = argument;\n }\n\n static ServiceMessage of(String name, String argument) {\n return new ServiceMessage(name, argument);\n }\n\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(SERVICE_MESSAGE_START);\n sb.append(name);\n sb.append(' ');\n sb.append('\\'');\n sb.append(escape(argument));\n sb.append('\\'');\n sb.append(SERVICE_MESSAGE_END);\n return sb.toString();\n }\n\n private String escape(String s) {\n StringBuilder sb = new StringBuilder();\n for (char c : s.toCharArray()) {\n sb.append(escape(c));\n }\n return sb.toString();\n }\n\n private String escape(char c) {\n String escapeCharacter = \"|\";\n switch (c) {\n case '\\n':\n return escapeCharacter + \"n\";\n case '\\r':\n return escapeCharacter + \"r\";\n case '|':\n return escapeCharacter + \"|\";\n case '\\'':\n return escapeCharacter + \"\\'\";\n case '[':\n return escapeCharacter + \"[\";\n case ']':\n return escapeCharacter + \"]\";\n default:\n return c < 128 ? Character.toString(c) : escapeCharacter + String.format(\"0x%04x\", (int) c);\n }\n }\n\n}\n","subject":"Fix message escaping to be the same as in the init script"} {"old_contents":"package org.beanmaker.util;\n\nimport java.util.Locale;\nimport java.util.ResourceBundle;\n\npublic class BaseView {\n final private String resourceBundleName;\n protected ResourceBundle resourceBundle;\n protected Locale locale;\n\n public BaseView(final String resourceBundleName) {\n this.resourceBundleName = resourceBundleName;\n setLocale(Locale.getDefault());\n }\n\n public void setLocale(final Locale locale) {\n this.locale = locale;\n resourceBundle = ResourceBundle.getBundle(resourceBundleName, locale);\n }\n}\n","new_contents":"package org.beanmaker.util;\n\nimport java.util.Locale;\nimport java.util.ResourceBundle;\n\npublic class BaseView {\n final private String resourceBundleName;\n protected ResourceBundle resourceBundle;\n protected Locale locale;\n\n public BaseView(final String resourceBundleName) {\n this.resourceBundleName = resourceBundleName;\n initLocale(Locale.getDefault());\n }\n\n private void initLocale(final Locale locale) {\n this.locale = locale;\n resourceBundle = ResourceBundle.getBundle(resourceBundleName, locale);\n }\n\n public void setLocale(final Locale locale) {\n initLocale(locale);\n }\n}\n","subject":"Move resource bundle management to private non overridable function"} {"old_contents":"package com.elmakers.mine.bukkit.api.event;\n\nimport org.bukkit.event.Event;\nimport org.bukkit.event.HandlerList;\n\nimport com.elmakers.mine.bukkit.api.action.CastContext;\nimport com.elmakers.mine.bukkit.api.magic.Mage;\nimport com.elmakers.mine.bukkit.api.spell.Spell;\nimport com.elmakers.mine.bukkit.api.spell.SpellResult;\n\n\/**\n * A custom event that the Magic plugin will fire any time a\n * Mage casts a Spell.\n *\/\npublic class CastEvent extends Event {\n private final CastContext context;\n\n private static final HandlerList handlers = new HandlerList();\n\n public CastEvent(CastContext context) {\n this.context = context;\n }\n\n @Override\n public HandlerList getHandlers() {\n return handlers;\n }\n\n public static HandlerList getHandlerList() {\n return handlers;\n }\n\n public Mage getMage() {\n return context.getMage();\n }\n\n public Spell getSpell() {\n return context.getSpell();\n }\n\n public CastContext getContext() {\n return context;\n }\n\n public SpellResult getSpellResult() {\n return context.getResult();\n }\n}\n","new_contents":"package com.elmakers.mine.bukkit.api.event;\n\nimport org.bukkit.event.Event;\nimport org.bukkit.event.HandlerList;\n\nimport com.elmakers.mine.bukkit.api.action.CastContext;\nimport com.elmakers.mine.bukkit.api.magic.Mage;\nimport com.elmakers.mine.bukkit.api.spell.Spell;\nimport com.elmakers.mine.bukkit.api.spell.SpellResult;\n\n\/**\n * A custom event that the Magic plugin will fire any time a\n * Mage casts a Spell.\n *\/\npublic class CastEvent extends Event {\n private final CastContext context;\n\n private static final HandlerList handlers = new HandlerList();\n\n public CastEvent(Mage mage, Spell spell, SpellResult result) {\n throw new IllegalArgumentException(\"Please create a CastEvent with CastContext now .. but also why are you creating a CastEvent?\");\n }\n\n public CastEvent(CastContext context) {\n this.context = context;\n }\n\n @Override\n public HandlerList getHandlers() {\n return handlers;\n }\n\n public static HandlerList getHandlerList() {\n return handlers;\n }\n\n public Mage getMage() {\n return context.getMage();\n }\n\n public Spell getSpell() {\n return context.getSpell();\n }\n\n public CastContext getContext() {\n return context;\n }\n\n public SpellResult getSpellResult() {\n return context.getResult();\n }\n}\n","subject":"Add back in previous constructor to make revapi happy, but no one should really be creating these anyway"} {"old_contents":"package SecureElection;\n\/**\n * Created by Klas Eskilson on 15-11-16.\n *\/\n\npublic class SecureElectionClient {\n\n public static void main(String[] args) {\n\n }\n}\n","new_contents":"package SecureElection;\n\nimport java.io.BufferedReader;\nimport java.io.FileInputStream;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.net.InetAddress;\nimport java.net.UnknownHostException;\nimport java.security.KeyStore;\nimport javax.net.ssl.*;\nimport SecureElection.Common.Settings;\n\n\/**\n * Created by Klas Eskilson on 15-11-16.\n *\/\n\npublic class SecureElectionClient {\n \/\/ constants\n private static final String CLIENTTRUSTSTORE = Settings.KEYLOCATION + \"ClientTruststore.ks\";\n private static final String CLIENTKEYSTORE = Settings.KEYLOCATION + \"ClientKeystore.ks\";\n private static final String CLIENTPASSWORD = \"somephrase\";\n\n \/\/ class variables\n BufferedReader socketIn;\n PrintWriter socketOut;\n\n \/**\n * setup ssl client\n * @param addr the address to connect to\n *\/\n private void setupSSLClient(InetAddress hostAddr) {\n try {\n \/\/ load keystores\n KeyStore ks = KeyStore.getInstance(\"JCEKS\");\n ks.load(new FileInputStream(CLIENTKEYSTORE),\n CLIENTPASSWORD.toCharArray());\n KeyStore ts = KeyStore.getInstance(\"JCEKS\");\n ts.load(new FileInputStream(CLIENTTRUSTSTORE),\n CLIENTPASSWORD.toCharArray());\n\n \/\/ setup key managers\n KeyManagerFactory kmf = KeyManagerFactory.getInstance(\"SunX509\");\n kmf.init(ks, CLIENTPASSWORD.toCharArray());\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(\"SunX509\");\n tmf.init(ts);\n\n \/\/ setup ssl\n SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);\n SSLSocketFactory sslFact = sslContext.getSocketFactory();\n SSLSocket client = (SSLSocket) sslFact.createSocket(hostAddr, this.hostPort);\n client.setEnabledCipherSuites(client.getSupportedCipherSuites());\n\n \/\/ setup transmissions\n socketIn = new BufferedReader(new InputStreamReader(client.getInputStream()));\n socketOut = new PrintWriter(client.getOutputStream(), true);\n } catch (Exception e) {\n System.out.println(e);\n e.printStackTrace();\n }\n }\n\n public static void main(String[] args) {\n try {\n \/\/ setup connection\n InetAddress localhost = InetAddress.getLocalHost();\n setupSSLClient(localhost);\n } catch (UnknownHostException uhe) {\n System.out.println(uhe);\n uhe.printStackTrace();\n }\n\n }\n}\n","subject":"Add SSL setup to client"} {"old_contents":"import httpserver.WebServer;\nimport requests.CiphersuiteRequest;\n\npublic class Client {\n public static void main(String[] args) {\n WebServer ws = new WebServer();\n\n for (int i = 0; i < 10; i++) {\n new Thread(new CiphersuiteRequest()).start();\n }\n }\n}\n","new_contents":"import httpserver.WebServer;\nimport requests.CiphersuiteRequest;\nimport requests.Ecrypt2LevelRequest;\nimport requests.OpenPortRequest;\n\nimport java.util.Random;\n\npublic class Client {\n public static void main(String[] args) {\n WebServer ws = new WebServer();\n\n Random r = new Random();\n for (int i = 0; i < 10; i++) {\n switch (r.nextInt(3)) {\n case 0: new Thread(new CiphersuiteRequest()).start();\n break;\n case 1: new Thread(new Ecrypt2LevelRequest()).start();\n break;\n case 2: new Thread(new OpenPortRequest()).start();\n break;\n }\n }\n }\n}\n","subject":"Create random requests to test\/stress system."} {"old_contents":"package com.yammer.stresstime.resources;\n\nimport com.yammer.stresstime.auth.Authorize;\nimport com.yammer.stresstime.auth.Role;\nimport com.yammer.stresstime.entities.User;\nimport io.dropwizard.hibernate.UnitOfWork;\n\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.Produces;\nimport javax.ws.rs.core.MediaType;\nimport javax.ws.rs.core.Response;\nimport java.util.HashMap;\nimport java.util.Map;\n\n@Path(\"\/current\")\n@Produces(MediaType.APPLICATION_JSON)\npublic class AuthorizationResource {\n\n @GET\n @UnitOfWork\n public Response getCurrent(\n @Authorize({Role.ADMIN, Role.MEMBER, Role.GUEST}) User user) {\n\n Map response = new HashMap<>();\n response.put(\"role\", user.getRole().toString());\n if (user.getEmployee() != null) {\n response.put(\"employeeId\", user.getEmployee().getId());\n }\n\n return Response.ok().entity(response).build();\n }\n}\n","new_contents":"package com.yammer.stresstime.resources;\n\nimport com.yammer.stresstime.auth.Authorize;\nimport com.yammer.stresstime.auth.Role;\nimport com.yammer.stresstime.entities.Group;\nimport com.yammer.stresstime.entities.Membership;\nimport com.yammer.stresstime.entities.User;\nimport io.dropwizard.hibernate.UnitOfWork;\n\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.Produces;\nimport javax.ws.rs.core.MediaType;\nimport javax.ws.rs.core.Response;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Collectors;\n\n@Path(\"\/current\")\n@Produces(MediaType.APPLICATION_JSON)\npublic class AuthorizationResource {\n\n @GET\n @UnitOfWork\n public Response getCurrent(\n @Authorize({Role.ADMIN, Role.MEMBER, Role.GUEST}) User user) {\n\n Map response = new HashMap<>();\n response.put(\"role\", user.getRole().toString());\n if (user.getEmployee() != null) {\n response.put(\"employeeId\", user.getEmployee().getId());\n List groupIds = user.getEmployee().getMemberships().stream()\n .filter(m -> m.isAdmin())\n .map(Membership::getGroup)\n .map(Group::getId)\n .collect(Collectors.toList());\n response.put(\"groupsAdmin\", groupIds);\n }\n\n return Response.ok().entity(response).build();\n }\n}\n","subject":"Add group admin information to '\/current' request"} {"old_contents":"package net.interfax.rest.client.impl;\n\nimport com.github.tomakehurst.wiremock.junit.WireMockRule;\nimport net.interfax.rest.client.InterFAXClient;\nimport net.interfax.rest.client.domain.Response;\nimport org.junit.Rule;\nimport org.junit.Test;\n\nimport java.io.File;\n\n\npublic class InterFAXJerseyClientTest {\n\n @Rule\n public WireMockRule wireMockRule = new WireMockRule(8089);\n\n @Test\n public void testSendFax() throws Exception {\n\n String faxNumber = \"+442084978672\";\n\n String absoluteFilePath = this.getClass().getClassLoader().getResource(\"test.pdf\").getFile();\n File file = new File(absoluteFilePath);\n\n InterFAXClient interFAXClient = new InterFAXJerseyClient();\n Response response = interFAXClient.sendFax(faxNumber, file);\n System.out.println(response.getStatusCode());\n }\n}","new_contents":"package net.interfax.rest.client.impl;\n\nimport com.github.tomakehurst.wiremock.junit.WireMockRule;\nimport net.interfax.rest.client.InterFAXClient;\nimport net.interfax.rest.client.domain.Response;\nimport org.junit.Assert;\nimport org.junit.Rule;\nimport org.junit.Test;\n\nimport java.io.File;\n\n\npublic class InterFAXJerseyClientTest {\n\n @Rule\n public WireMockRule wireMockRule = new WireMockRule(8089);\n\n @Test\n public void testSendFax() throws Exception {\n\n String faxNumber = \"+442084978672\";\n\n String absoluteFilePath = this.getClass().getClassLoader().getResource(\"test.pdf\").getFile();\n File file = new File(absoluteFilePath);\n\n InterFAXClient interFAXClient = new InterFAXJerseyClient();\n Response response = interFAXClient.sendFax(faxNumber, file);\n Assert.assertEquals(201, response.getStatusCode());\n }\n}","subject":"Add status code assertion in test case"} {"old_contents":"package org.uct.cs.simplify.ply.reader;\n\nimport java.nio.ByteBuffer;\nimport java.nio.ByteOrder;\n\npublic class Vertex\n{\n public float x;\n public float y;\n public float z;\n public byte[] data;\n\n public Vertex(byte[] input)\n {\n this.data = input;\n ByteBuffer bf = ByteBuffer.wrap(input);\n bf.order(ByteOrder.LITTLE_ENDIAN);\n this.x = bf.getFloat();\n this.y = bf.getFloat();\n this.z = bf.getFloat();\n }\n\n\n}\n","new_contents":"package org.uct.cs.simplify.ply.reader;\n\nimport java.nio.ByteBuffer;\nimport java.nio.ByteOrder;\n\npublic class Vertex\n{\n public float x;\n public float y;\n public float z;\n \/\/ public int r;\n\/\/ public int g;\n\/\/ public int b;\n\/\/ public int a;\n public byte[] data;\n\n public Vertex(byte[] input)\n {\n this.data = input;\n ByteBuffer bf = ByteBuffer.wrap(input);\n bf.order(ByteOrder.LITTLE_ENDIAN);\n this.x = bf.getFloat();\n this.y = bf.getFloat();\n this.z = bf.getFloat();\n\/\/\n\/\/ this.r = 0xFF & ((int)bf.get());\n\/\/ this.g = 0xFF & ((int)bf.get());\n\/\/ this.b = 0xFF & ((int)bf.get());\n\/\/ this.a = 0xFF & ((int)bf.get());\n }\n\n\n}\n","subject":"Add colour stuff to vertex but commented out"} {"old_contents":"package io.luna.game.model;\n\nimport io.luna.game.model.mob.Player;\nimport org.junit.Test;\n\n\/**\n * A test that ensures that functions within {@link Position} are functioning correctly.\n *\n * @author lare96 \n *\/\nfinal class AreaTest {\n\n \/**\n * Ensures the north east {@code x} coordinate is larger than the south west {@code x} coordinate.\n *\/\n @Test(expected = IllegalArgumentException.class)\n void testNorthEastX() {\n newArea(0, 0, -1, 0);\n }\n\n \/**\n * Ensures the north east {@code y} coordinate is larger than the south west {@code y} coordinate.\n *\/\n @Test(expected = IllegalArgumentException.class)\n void testNorthEastY() {\n newArea(0, 0, 0, -1);\n }\n\n \/**\n * Constructs a new {@link Area} for this test.\n *\/\n private void newArea(int swX, int swY, int neX, int neY) {\n new Area(swX, swY, neX, neY) {\n @Override\n public void enter(Player player) {\n\n }\n\n @Override\n public void exit(Player player) {\n\n }\n };\n }\n}","new_contents":"package io.luna.game.model;\n\nimport io.luna.game.model.mob.Player;\nimport org.junit.Test;\n\n\/**\n * A test that ensures that functions within {@link Position} are functioning correctly.\n *\n * @author lare96 \n *\/\npublic final class AreaTest {\n\n \/**\n * Ensures the north east {@code x} coordinate is larger than the south west {@code x} coordinate.\n *\/\n @Test(expected = IllegalArgumentException.class)\n public void testNorthEastX() {\n newArea(0, 0, -1, 0);\n }\n\n \/**\n * Ensures the north east {@code y} coordinate is larger than the south west {@code y} coordinate.\n *\/\n @Test(expected = IllegalArgumentException.class)\n public void testNorthEastY() {\n newArea(0, 0, 0, -1);\n }\n\n \/**\n * Constructs a new {@link Area} for this test.\n *\/\n private void newArea(int swX, int swY, int neX, int neY) {\n new Area(swX, swY, neX, neY) {\n @Override\n public void enter(Player player) {\n\n }\n\n @Override\n public void exit(Player player) {\n\n }\n };\n }\n}","subject":"Make functions public for unit test"} {"old_contents":"package org.apache.commons.vfs2.provider;\r\n\r\nimport junit.framework.Assert;\r\n\r\nimport org.junit.Test;\r\n\r\npublic class UriParserTestCase\r\n{\r\n\r\n @Test\r\n public void testColonInFileName()\r\n {\r\n Assert.assertEquals(null, UriParser.extractScheme(\"some\/path\/some:file\"));\r\n }\r\n\r\n @Test\r\n public void testNormalScheme()\r\n {\r\n Assert.assertEquals(\"ftp\", UriParser.extractScheme(\"ftp:\/\/user:pass@host\/some\/path\/some:file\"));\r\n }\r\n\r\n}\r\n","new_contents":"\/*\r\n * Licensed to the Apache Software Foundation (ASF) under one or more\r\n * contributor license agreements. See the NOTICE file distributed with\r\n * this work for additional information regarding copyright ownership.\r\n * The ASF licenses this file to You under the Apache License, Version 2.0\r\n * (the \"License\"); you may not use this file except in compliance with\r\n * the License. You may obtain a copy of the License at\r\n *\r\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\/\r\npackage org.apache.commons.vfs2.provider;\r\n\r\nimport junit.framework.Assert;\r\n\r\nimport org.junit.Test;\r\n\r\n\/**\r\n * \r\n * @version $Id$\r\n *\/\r\npublic class UriParserTestCase\r\n{\r\n\r\n @Test\r\n public void testColonInFileName()\r\n {\r\n Assert.assertEquals(null, UriParser.extractScheme(\"some\/path\/some:file\"));\r\n }\r\n\r\n @Test\r\n public void testNormalScheme()\r\n {\r\n Assert.assertEquals(\"ftp\", UriParser.extractScheme(\"ftp:\/\/user:pass@host\/some\/path\/some:file\"));\r\n }\r\n\r\n}\r\n","subject":"Add missing Apache license header."} {"old_contents":"package com.tngtech.jgiven.config;\n\nimport java.util.concurrent.ExecutionException;\n\nimport com.google.common.base.Throwables;\nimport com.google.common.cache.CacheBuilder;\nimport com.google.common.cache.CacheLoader;\nimport com.google.common.cache.LoadingCache;\nimport com.tngtech.jgiven.annotation.JGivenConfiguration;\nimport com.tngtech.jgiven.impl.util.ReflectionUtil;\n\npublic class ConfigurationUtil {\n\n private static final LoadingCache, AbstractJGivenConfiguration> configurations = CacheBuilder.newBuilder().build(\n new CacheLoader, AbstractJGivenConfiguration>() {\n @Override\n public AbstractJGivenConfiguration load( Class key ) throws Exception {\n AbstractJGivenConfiguration result = (AbstractJGivenConfiguration) ReflectionUtil.newInstance( key );\n result.configure();\n return result;\n }\n } );\n\n public static AbstractJGivenConfiguration getConfiguration( Class testClass ) {\n JGivenConfiguration annotation = testClass.getAnnotation( JGivenConfiguration.class );\n Class configuration;\n if( annotation == null ) {\n configuration = DefaultConfiguration.class;\n } else {\n configuration = annotation.value();\n }\n\n try {\n return configurations.get( configuration );\n } catch( ExecutionException e ) {\n throw Throwables.propagate( e.getCause() );\n }\n }\n}\n","new_contents":"package com.tngtech.jgiven.config;\n\nimport com.google.common.cache.CacheBuilder;\nimport com.google.common.cache.CacheLoader;\nimport com.google.common.cache.LoadingCache;\nimport com.tngtech.jgiven.annotation.JGivenConfiguration;\nimport com.tngtech.jgiven.impl.util.ReflectionUtil;\nimport java.util.Optional;\nimport java.util.concurrent.ExecutionException;\n\n\npublic class ConfigurationUtil {\n\n private static final LoadingCache, AbstractJGivenConfiguration> configurations =\n CacheBuilder.newBuilder().build(\n new CacheLoader, AbstractJGivenConfiguration>() {\n @Override\n public AbstractJGivenConfiguration load(Class key) {\n AbstractJGivenConfiguration result = (AbstractJGivenConfiguration) ReflectionUtil.newInstance(key);\n result.configure();\n return result;\n }\n });\n\n @SuppressWarnings({\"unchecked\"})\n public static AbstractJGivenConfiguration getConfiguration(\n Class testClass) {\n Class configuration = Optional.ofNullable(testClass)\n .map(content -> content.getAnnotation(JGivenConfiguration.class))\n .map(content -> (Class) content.value())\n .orElse((Class) DefaultConfiguration.class);\n\n try {\n return configurations.get(configuration);\n } catch (ExecutionException e) {\n throw new RuntimeException(e.getCause());\n }\n }\n}\n","subject":"Introduce optional into the configuration util to simplify the code"} {"old_contents":"\/\/ Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\npackage com.yahoo.vespa.athenz.client.zms.bindings;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\nimport java.util.List;\n\n\/**\n * @author olaa\n *\/\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class PolicyEntity {\n\n @JsonInclude(JsonInclude.Include.NON_EMPTY)\n private final List assertions;\n private final String name;\n\n public PolicyEntity(@JsonProperty(\"name\") String name,\n @JsonProperty(\"assertions\") List assertions) {\n this.name = name;\n this.assertions = assertions;\n }\n\n public String getName() {\n return name;\n }\n\n public List getAssertions() {\n return assertions;\n }\n}\n","new_contents":"\/\/ Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\npackage com.yahoo.vespa.athenz.client.zms.bindings;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\nimport java.util.List;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\n\/**\n * @author olaa\n *\/\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class PolicyEntity {\n private static final Pattern namePattern = Pattern.compile(\"^(?[^:]+):policy\\\\.(?.*)$\");\n\n @JsonInclude(JsonInclude.Include.NON_EMPTY)\n private final List assertions;\n private final String name;\n\n public PolicyEntity(@JsonProperty(\"name\") String name,\n @JsonProperty(\"assertions\") List assertions) {\n this.name = nameFromResourceString(name);\n this.assertions = assertions;\n }\n\n private static String nameFromResourceString(String resource) {\n Matcher matcher = namePattern.matcher(resource);\n if (!matcher.matches())\n throw new IllegalArgumentException(\"Could not find policy name from resource string: \" + resource);\n return matcher.group(\"name\");\n }\n\n public String getName() {\n return name;\n }\n\n public List getAssertions() {\n return assertions;\n }\n}\n","subject":"Read policy from resource name"} {"old_contents":"package model;\nimport java.util.ArrayList;\n\/**\n * Created by ano on 2016. 5. 18..\n *\/\npublic class Line {\n private String content;\/\/이 라인이 가지고 있는 컨텐츠\n\n private int blockIndex; \/\/ 이 라인이 속해있는 블럭의 index. -1이면 속하는 블럭이 없다는 것\n private boolean isWhitespace;\/\/compare로 생긴 공백 줄이면 true;\n private static ArrayList blockArrayList;\/\/블럭을 가지고 있는 arraylist\n public Line(String input)\n {\n content = input;\n }\n public String getLine(boolean isLastLine) \/\/마지막 줄이면 개행을 없이 그것이 아니면 개행 있이 content를 반환합니다\n {\n if(isLastLine) return content;\n else return content + \"\\n\";\n }\n\n\n public enum Highlight\/\/하이라이트 객체\n {\n unHilighted, whitespace, isDifferent,selected\n }\n public Highlight getHighlight()\n {\n if(blockIndex == -1) return Highlight.unHilighted;\n else if(isWhitespace) return Highlight.whitespace;\n else if(blockArrayList.get(blockIndex).getSelected()) return Highlight.selected;\n else return Highlight.isDifferent;\n }\n\n public void setBlockArray(ArrayList inArrayList)\n {\n blockArrayList = inArrayList;\n }\n\n\n\n}\n","new_contents":"package model;\nimport java.util.ArrayList;\n\/**\n * Created by ano on 2016. 5. 18..\n *\/\npublic class Line {\n private String content;\/\/이 라인이 가지고 있는 컨텐츠\n\n private int blockIndex; \/\/ 이 라인이 속해있는 블럭의 index. -1이면 속하는 블럭이 없다는 것\n private boolean isWhitespace;\/\/compare로 생긴 공백 줄이면 true;\n private static ArrayList blockArrayList;\/\/블럭을 가지고 있는 arraylist\n public Line(String input)\n {\n content = input;\n blockIndex = -1;\n }\n public Line(String input,int index, boolean whiteSpace)\n {\n content = input;\n blockIndex = index;\n isWhitespace = whiteSpace;\n }\n public String getLine(boolean isLastLine) \/\/마지막 줄이면 개행을 없이 그것이 아니면 개행 있이 content를 반환합니다\n {\n if(isLastLine) return content;\n else return content + \"\\n\";\n }\n\n\n public enum Highlight\/\/하이라이트 객체\n {\n unHilighted, whitespace, isDifferent,selected\n }\n public Highlight getHighlight()\n {\n if(blockIndex == -1) return Highlight.unHilighted;\n else if(isWhitespace) return Highlight.whitespace;\n else if(blockArrayList.get(blockIndex).getSelected()) return Highlight.selected;\n else return Highlight.isDifferent;\n }\n\n public static void setBlockArray(ArrayList inArrayList)\n {\n blockArrayList = inArrayList;\n }\n\n\n\n}\n","subject":"Make blockArrayList static Make setBlockArray static method"} {"old_contents":"\/* Currently managed by Tarun Sunkaraneni, and Ben Rose\n * This class manages all motor writing and managment. May need to deal with complex Gyro\n * input. \n *\/\npackage edu.ames.frc.robot;\n\npublic class MotorControl {\n \n \/* This converts the direction we want to go (from 0 to 1, relative to the robot's base)\n * and speed (from 0 to 1) directly to values for the three omni-wheeled motors.\n *\/\n double[] convertHeadingToMotorCommands(double direction, double speed) {\n double[] motorvalue = new double[3];\n \n \/* so, we'll define the direction we want to go as \"forward\". There are\n * 3 different points where only two motors will need to run (if the direction\n * is parallel to a motor's axle).\n *\/\n \/\/ 0 is what we define as the \"front\" motor - what we measure our heading angle from,\n \/\/ 1 is the motor one position clockwise from that, and\n \/\/ 2 is the motor one position counter-clockwise from 0.\n motorvalue[0] = speed * Math.sin(direction);\n motorvalue[1] = speed * Math.sin(direction - (2 * Math.PI \/ 3));\n motorvalue[2] = speed * Math.sin(direction + (2 * Math.PI \/ 3));\n \n return motorvalue;\n }\n}\n","new_contents":"\/* Currently managed by Tarun Sunkaraneni, and Ben Rose\n * This class manages all motor writing and managment. May need to deal with complex Gyro\n * input. \n *\/\npackage edu.ames.frc.robot;\n\npublic class MotorControl {\n \n \/* This converts the direction we want to go (from 0 to 1, relative to the robot's base)\n * and speed (from 0 to 1) directly to values for the three omni-wheeled motors.\n *\/\n double[] convertHeadingToMotorCommands(double direction, double speed) {\n double[] motorvalue = new double[3];\n \n \/* so, we'll define the direction we want to go as \"forward\". There are\n * 3 different points where only two motors will need to run (if the direction\n * is parallel to a motor's axle).\n *\/\n \/\/ 0 is what we define as the \"front\" motor - what we measure our heading angle from,\n \/\/ 1 is the motor one position clockwise from that, and\n \/\/ 2 is the motor one position counter-clockwise from 0.\n motorvalue[0] = speed * Math.sin(direction);\n motorvalue[1] = speed * Math.sin(direction - (2 * Math.PI \/ 3));\n motorvalue[2] = speed * Math.sin(direction + (2 * Math.PI)) \/ 3;\n \n return motorvalue;\n }\n}\n","subject":"Revert \"Another minor fix for the speed\/direction conversion\""} {"old_contents":"package som.langserv.som;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport trufflesom.compiler.Lexer;\n\n\npublic class SomLexer extends Lexer {\n private List commentTokens = new ArrayList();\n\n protected SomLexer(final String content) {\n super(content);\n }\n\n @Override\n protected void skipComment() {\n if (currentChar() == '\"') {\n int length = 0;\n int col = state.ptr - state.lastLineEnd;\n do {\n length++;\n if (currentChar() == '\\n') {\n addCoordsToTokens(state.lineNumber - 1, 0, length);\n state.lineNumber += 1;\n state.lastLineEnd = state.ptr;\n length = 0;\n }\n state.incPtr();\n } while (currentChar() != '\"');\n addCoordsToTokens(state.lineNumber - 1, col - 1, length + 1);\n state.incPtr();\n }\n }\n\n private void addCoordsToTokens(final int line, final int col, final int length) {\n commentTokens.add(line);\n commentTokens.add(col);\n commentTokens.add(length);\n commentTokens.add(5);\n commentTokens.add(0);\n }\n\n public List getCommentsPositions() {\n return commentTokens;\n }\n}\n","new_contents":"package som.langserv.som;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport som.langserv.SemanticTokenType;\nimport trufflesom.compiler.Lexer;\n\n\npublic class SomLexer extends Lexer {\n private List commentTokens = new ArrayList();\n\n protected SomLexer(final String content) {\n super(content);\n }\n\n @Override\n protected void skipComment() {\n if (currentChar() == '\"') {\n int length = 0;\n int col = state.ptr - state.lastLineEnd;\n do {\n length++;\n if (currentChar() == '\\n') {\n addCoordsToTokens(state.lineNumber - 1, 0, length);\n state.lineNumber += 1;\n state.lastLineEnd = state.ptr;\n length = 0;\n }\n state.incPtr();\n } while (currentChar() != '\"');\n addCoordsToTokens(state.lineNumber - 1, col - 1, length + 1);\n state.incPtr();\n }\n }\n\n private void addCoordsToTokens(final int line, final int col, final int length) {\n commentTokens.add(line);\n commentTokens.add(col);\n commentTokens.add(length);\n commentTokens.add(SemanticTokenType.COMMENT.ordinal()); \/\/ token type\n commentTokens.add(0); \/\/ token modifiers\n }\n\n public List getCommentsPositions() {\n return commentTokens;\n }\n}\n","subject":"Fix token types for comments in SOM"} {"old_contents":"\/*\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\/\n\npackage com.mpalourdio.springboottemplate.service;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.InjectMocks;\nimport org.mockito.Mock;\nimport org.mockito.Mockito;\nimport org.mockito.junit.MockitoJUnitRunner;\n\n@RunWith(MockitoJUnitRunner.class)\npublic class UselessBeanTest {\n\n @InjectMocks\n private UselessBean uselessBean;\n\n @Mock\n private ABeanIWantToMock aBeanIWantToMock;\n\n @Test\n public void testMyMockReturnFalseInTest() {\n Mockito.when(aBeanIWantToMock.iAlwaysReturnFalse()).thenReturn(true);\n Assert.assertTrue(uselessBean.iWantToMockThisMethod());\n }\n}\n","new_contents":"\/*\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\/\n\npackage com.mpalourdio.springboottemplate.service;\n\nimport org.junit.Assert;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.Mock;\nimport org.mockito.Mockito;\nimport org.mockito.junit.MockitoJUnitRunner;\n\n@RunWith(MockitoJUnitRunner.class)\npublic class UselessBeanTest {\n\n private UselessBean uselessBean;\n\n @Mock\n private ABeanIWantToMock aBeanIWantToMock;\n\n @Before\n public void setUp() {\n uselessBean = new UselessBean(aBeanIWantToMock);\n }\n\n @Test\n public void testMyMockReturnFalseInTest() {\n Mockito.when(aBeanIWantToMock.iAlwaysReturnFalse()).thenReturn(true);\n Assert.assertTrue(uselessBean.iWantToMockThisMethod());\n }\n}\n","subject":"Initialize object under test in setup"} {"old_contents":"package com.csforge.reader;\n\nimport org.apache.cassandra.db.rows.Unfiltered;\n\nimport java.util.stream.Stream;\n\n\/**\n *\/\npublic interface Partition {\n\n \/**\n * A timestamp (typically in microseconds since the unix epoch, although this is not enforced) after which\n * data should be considered deleted. If set to Long.MIN_VALUE, this implies that the data has not been marked\n * for deletion at all.\n *\/\n public long markedForDeleteAt();\n\n \/**\n * The local server timestamp, in seconds since the unix epoch, at which this tombstone was created. This is\n * only used for purposes of purging the tombstone after gc_grace_seconds have elapsed.\n *\/\n public int localDeletionTime();\n\n public Unfiltered staticRow();\n\n public Stream rows();\n}\n","new_contents":"package com.csforge.reader;\n\nimport org.apache.cassandra.db.rows.Row;\nimport org.apache.cassandra.db.rows.Unfiltered;\n\nimport java.util.stream.Stream;\n\n\/**\n *\/\npublic interface Partition {\n\n \/**\n * A timestamp (typically in microseconds since the unix epoch, although this is not enforced) after which\n * data should be considered deleted. If set to Long.MIN_VALUE, this implies that the data has not been marked\n * for deletion at all.\n *\/\n public long markedForDeleteAt();\n\n \/**\n * The local server timestamp, in seconds since the unix epoch, at which this tombstone was created. This is\n * only used for purposes of purging the tombstone after gc_grace_seconds have elapsed.\n *\/\n public int localDeletionTime();\n\n public Row staticRow();\n\n public Stream rows();\n}\n","subject":"Change staticRow() to return Row."} {"old_contents":"package io.github.droidkaigi.confsched2017.debug;\n\nimport com.tomoima.debot.strategy.DebotStrategy;\n\nimport android.app.Activity;\nimport android.support.annotation.NonNull;\n\n\npublic class ClearCache extends DebotStrategy {\n\n @Override\n public void startAction(@NonNull Activity activity) {\n \/\/ Do nothing\n }\n}\n","new_contents":"package io.github.droidkaigi.confsched2017.debug;\n\nimport com.tomoima.debot.strategy.DebotStrategy;\n\nimport android.app.Activity;\nimport android.support.annotation.NonNull;\n\nimport javax.inject.Inject;\n\n\npublic class ClearCache extends DebotStrategy {\n\n @Inject\n public ClearCache() {\n }\n\n @Override\n public void startAction(@NonNull Activity activity) {\n \/\/ Do nothing\n }\n}\n","subject":"Add inject annotation for release build"} {"old_contents":"package com.twu.biblioteca;\nimport java.util.List;\nimport java.util.ArrayList;\n\npublic class BibliotecaApp {\n\n private static List bookList = initBookList();\n\n public static void main(String[] args) {\n System.out.println(\"Welcome to Biblioteca!\");\n printBookList();\n }\n\n private static void printBookList() {\n System.out.println(\"Book list:\");\n for (Book book : bookList) {\n System.out.println(book.toString());\n }\n }\n\n private static List initBookList() {\n List newBookList = new ArrayList();\n newBookList.add(createNewBook(\"Test-Driven Development By Example\", \"Kent Beck\", 2003));\n newBookList.add(createNewBook(\"The Agile Samurai\", \"Jonathan Rasmusson\", 2010));\n newBookList.add(createNewBook(\"Head First Java\", \"Kathy Sierra & Bert Bates\", 2005));\n newBookList.add(createNewBook(\"Don't Make Me Think, Revisited: A Common Sense Approach to Web Usability\", \"Steve Krug\", 2014));\n return newBookList;\n }\n\n private static Book createNewBook(String title, String author, int yearPublished) {\n return new Book(title, author, yearPublished);\n }\n}\n","new_contents":"package com.twu.biblioteca;\nimport java.util.List;\nimport java.util.ArrayList;\n\npublic class BibliotecaApp {\n\n private static List bookList = initBookList();\n\n public static void main(String[] args) {\n System.out.println(\"Welcome to Biblioteca!\");\n printBookList();\n }\n\n private static void printBookList() {\n System.out.println(\"Book List\");\n System.out.print(String.format(\"%-42s | %-32s | %-12s\\n\", \"Title\", \"Author\", \"Year Published\"));\n String leftAlignFormat = \"%-42s | %-32s | %-4d\\n\";\n for (Book book : bookList) {\n System.out.print(String.format(leftAlignFormat, book.getTitle(), book.getAuthor(), book.getYearPublished()));\n }\n }\n\n private static List initBookList() {\n List newBookList = new ArrayList();\n newBookList.add(createNewBook(\"Test-Driven Development By Example\", \"Kent Beck\", 2003));\n newBookList.add(createNewBook(\"The Agile Samurai\", \"Jonathan Rasmusson\", 2010));\n newBookList.add(createNewBook(\"Head First Java\", \"Kathy Sierra & Bert Bates\", 2005));\n newBookList.add(createNewBook(\"Don't Make Me Think, Revisited\", \"Steve Krug\", 2014));\n return newBookList;\n }\n\n private static Book createNewBook(String title, String author, int yearPublished) {\n return new Book(title, author, yearPublished);\n }\n}\n","subject":"Print book list with author and year published details"} {"old_contents":"package org.codehaus.modello.plugin;\n\n\/*\n * LICENSE\n *\/\n\nimport java.io.Reader;\nimport java.util.Properties;\n\nimport org.codehaus.modello.Model;\nimport org.codehaus.modello.ModelloException;\n\n\/**\n * @author Trygve Laugstøl<\/a>\n * @version $Id$\n *\/\npublic interface ModelloTranslator\n{\n Model translate( Reader reader, Properties parameters )\n throws ModelloException;\n}\n","new_contents":"package org.codehaus.modello.plugin;\n\n\/*\n * LICENSE\n *\/\n\nimport java.io.Reader;\nimport java.util.Properties;\n\nimport org.codehaus.modello.Model;\nimport org.codehaus.modello.ModelloException;\n\n\/**\n * @author Trygve Laugstøl<\/a>\n * @version $Id$\n *\/\npublic interface ModelloTranslator\n{\n Model translate( Reader reader, Properties parameters )\n throws ModelloException;\n\n void translate( Model model, Properties parameters )\n throws ModelloException;\n}\n","subject":"Add translator method from Model"} {"old_contents":"package bibifi;\n\nimport junit.framework.TestCase;\n\npublic class App1Test extends TestCase {\n\n\tpublic void testCtor() {\n\t\tApp1 app = new App1();\n\t\tApp1 app2 = new App1();\n\t}\n\t\n}\n","new_contents":"package bibifi;\n\nimport junit.framework.TestCase;\n\npublic class App1Test extends TestCase {\n\n\tpublic void testCtor() {\n\t\tApp1 app = new App1();\n\t\tApp1 app3 = new App1();\n\t}\n\t\n}\n","subject":"Test Commitment without addition files"} {"old_contents":"package io.ifar.goodies;\n\nimport ch.qos.logback.classic.Level;\nimport ch.qos.logback.classic.Logger;\nimport com.codahale.metrics.MetricRegistry;\nimport io.dropwizard.jackson.Jackson;\nimport io.dropwizard.setup.Environment;\nimport org.slf4j.LoggerFactory;\n\nimport javax.security.auth.login.Configuration;\nimport javax.validation.Validation;\n\n\/**\n *\n *\/\npublic class CliConveniences {\n\n public static void quietLogging(String... packages) {\n for (String pkg : packages) {\n ((Logger) LoggerFactory.getLogger(pkg)).setLevel(Level.OFF);\n }\n }\n\n public static Environment fabricateEnvironment(String name, Configuration configuration) {\n return new Environment(name, Jackson.newObjectMapper(), Validation.buildDefaultValidatorFactory().getValidator(),\n new MetricRegistry(),ClassLoader.getSystemClassLoader());\n }\n\n}\n","new_contents":"package io.ifar.goodies;\n\nimport ch.qos.logback.classic.Level;\nimport ch.qos.logback.classic.Logger;\nimport com.codahale.metrics.MetricRegistry;\nimport io.dropwizard.Configuration;\nimport io.dropwizard.jackson.Jackson;\nimport io.dropwizard.setup.Environment;\nimport org.slf4j.LoggerFactory;\n\nimport javax.validation.Validation;\n\n\/**\n *\n *\/\npublic class CliConveniences {\n\n public static void quietLogging(String... packages) {\n for (String pkg : packages) {\n ((Logger) LoggerFactory.getLogger(pkg)).setLevel(Level.OFF);\n }\n }\n\n public static Environment fabricateEnvironment(String name, Configuration configuration) {\n return new Environment(name, Jackson.newObjectMapper(), Validation.buildDefaultValidatorFactory().getValidator(),\n new MetricRegistry(),ClassLoader.getSystemClassLoader());\n }\n\n}\n","subject":"Clean up errant import of non-DW class."} {"old_contents":"\/**\n * Tests some evaluation order \/ side effects with && and ||.\n *\n * @author Elvis Stansvik \n *\/\n\n\/\/EXT:IWE\n\/\/EXT:BDJ\n\nclass SideEffects {\n public static void main(String[] args) {\n IncredibleMachine m;\n m = new IncredibleMachine();\n System.out.println(m.run()); \/\/ Should print 329.\n }\n}\n\nclass IncredibleMachine {\n int result;\n public int run() {\n result = 2;\n if (a(3, false) && a(5, true) \/* r = 2 + 3 *\/\n || (m(7, false) || s(11, true) && m(13, false)) \/* r = ((2 + 3) * 7 - 11) * 13 *\/\n || a(17, true) || m(19, true)) \/* r = ((2 + 3) * 7 - 11) * 13 + 17 = 329 *\/\n result = result;\n return result;\n }\n public boolean m(int value, boolean ret) {\n result = result * value;\n return ret;\n }\n public boolean a(int value, boolean ret) {\n result = result + value;\n return ret;\n }\n public boolean s(int value, boolean ret) {\n result = result - value;\n return ret;\n }\n}\n","new_contents":"\/**\n * Tests some evaluation order \/ side effects with && and ||.\n *\n * @author Elvis Stansvik \n *\/\n\n\/\/EXT:BDJ\n\nclass SideEffects {\n public static void main(String[] args) {\n IncredibleMachine m;\n m = new IncredibleMachine();\n System.out.println(m.run()); \/\/ Should print 329.\n }\n}\n\nclass IncredibleMachine {\n int result;\n public int run() {\n result = 2;\n if (a(3, false) && a(5, true) \/* r = 2 + 3 *\/\n || (m(7, false) || s(11, true) && m(13, false)) \/* r = ((2 + 3) * 7 - 11) * 13 *\/\n || a(17, true) || m(19, true)) \/* r = ((2 + 3) * 7 - 11) * 13 + 17 = 329 *\/\n result = result;\n else\n result = 42;\n return result;\n }\n public boolean m(int value, boolean ret) {\n result = result * value;\n return ret;\n }\n public boolean a(int value, boolean ret) {\n result = result + value;\n return ret;\n }\n public boolean s(int value, boolean ret) {\n result = result - value;\n return ret;\n }\n}\n","subject":"Remove EXT:IWE from side effects test case."} {"old_contents":"package server.game;\r\n\r\npublic enum Team {\r\n Red,\r\n Blue;\r\n}\r\n","new_contents":"package server.game;\r\n\r\npublic enum Team {\r\n Undefined(\"\"),\r\n Spectator(\"Spectator\"),\r\n Red(\"Red\"),\r\n Blue(\"Blue\");\r\n\r\n private String name;\r\n\r\n Team(String name) {\r\n this.name = name;\r\n }\r\n\r\n public String getName() {\r\n return name;\r\n }\r\n}\r\n","subject":"Add a string in the team enum"} {"old_contents":"import org.junit.jupiter.api.Test;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nclass MathUtilsTest {\n\n @Test\n void testAdd() {\n MathUtils math = new MathUtils();\n assertEquals(5, math.add(3,2), \"The add method should add two numbers\");\n }\n\n @Test\n void testDivide(){\n MathUtils math = new MathUtils();\n assertEquals(3,math.divide(6,2), \"Divide method should divide two numbers\");\n assertThrows(ArithmeticException.class, () -> math.divide(1,0), \"Divide by zero should throw\");\n }\n\n @Test\n void testComputeArea() {\n MathUtils math = new MathUtils();\n assertEquals(78,math.computeArea(5),\"Compute area method should return circle area\");\n }\n}","new_contents":"import org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nclass MathUtilsTest {\n MathUtils mathUtils;\n\n @BeforeEach\n void init(){\n mathUtils = new MathUtils();\n }\n\n @Test\n void testAdd() {\n assertEquals(5, mathUtils.add(3,2), \"The add method should add two numbers\");\n }\n\n @Test\n void testDivide(){\n assertEquals(3,mathUtils.divide(6,2), \"Divide method should divide two numbers\");\n assertThrows(ArithmeticException.class, () -> mathUtils.divide(1,0), \"Divide by zero should throw\");\n }\n\n @Test\n void testComputeArea() {\n assertEquals(78,mathUtils.computeArea(5),\"Compute area method should return circle area\");\n }\n}","subject":"Refactor test to use BeforeEach to initialize"} {"old_contents":"package org.xdi.service.cdi.event;\n\nimport javax.enterprise.util.AnnotationLiteral;\nimport javax.inject.Qualifier;\nimport java.lang.annotation.Documented;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.Target;\n\nimport static java.lang.annotation.ElementType.*;\nimport static java.lang.annotation.RetentionPolicy.RUNTIME;\n\n\/**\n * @author Yuriy Movchan Date: 04\/13\/2017\n *\/\n@Qualifier\n@Retention(RUNTIME)\n@Target({ METHOD, FIELD, PARAMETER, TYPE })\n@Documented\npublic @interface ApplicationInitialized {\n\n public static final class Literal extends AnnotationLiteral implements ApplicationInitialized {\n\n private static final long serialVersionUID = 4891987789146132930L;\n\n public static final Literal INSTANCE = new Literal();\n }\n\n}\n","new_contents":"package org.xdi.service.cdi.event;\n\nimport javax.enterprise.context.ApplicationScoped;\nimport javax.enterprise.context.Initialized.Literal;\nimport javax.enterprise.util.AnnotationLiteral;\nimport javax.inject.Qualifier;\nimport java.lang.annotation.Documented;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.Target;\n\nimport static java.lang.annotation.ElementType.*;\nimport static java.lang.annotation.RetentionPolicy.RUNTIME;\n\nimport java.lang.annotation.Annotation;\n\n\/**\n * @author Yuriy Movchan Date: 04\/13\/2017\n *\/\n@Qualifier\n@Retention(RUNTIME)\n@Target({ METHOD, FIELD, PARAMETER, TYPE })\n@Documented\npublic @interface ApplicationInitialized {\n\n \/**\n * The scope for which to observe initialization\n *\/\n Class value();\n\n public static final class Literal extends AnnotationLiteral implements ApplicationInitialized {\n\n public static final Literal APPLICATION = of(ApplicationScoped.class);\n\n private static final long serialVersionUID = 1L;\n\n private final Class value;\n\n public static Literal of(Class value) {\n return new Literal(value);\n }\n\n private Literal(Class value) {\n this.value = value;\n }\n\n @Override\n public Class value() {\n \/\/ TODO Auto-generated method stub\n return null;\n }\n }\n\n}\n","subject":"Add event to notify plugins about finish application initialization"} {"old_contents":"package org.zanata.rest.client;\n\nimport javax.ws.rs.Consumes;\nimport javax.ws.rs.DELETE;\nimport javax.ws.rs.GET;\nimport javax.ws.rs.PUT;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.PathParam;\nimport javax.ws.rs.Produces;\n\nimport org.jboss.resteasy.client.ClientResponse;\nimport org.zanata.common.LocaleId;\nimport org.zanata.rest.MediaTypes;\nimport org.zanata.rest.dto.Glossary;\nimport org.zanata.rest.service.GlossaryResource;\n\n@Produces({ MediaTypes.APPLICATION_ZANATA_GLOSSARY_XML, MediaTypes.APPLICATION_ZANATA_GLOSSARY_JSON })\n@Consumes({ MediaTypes.APPLICATION_ZANATA_GLOSSARY_XML, MediaTypes.APPLICATION_ZANATA_GLOSSARY_JSON })\npublic interface IGlossaryResource extends GlossaryResource\n{\n public static final String SERVICE_PATH = \"\/glossary\";\n\n @Override\n @GET\n public ClientResponse getEntries();\n\n @Override\n @GET\n @Path(\"{locale}\")\n public ClientResponse get(@PathParam(\"locale\") LocaleId locale);\n\n @Override\n @PUT\n public ClientResponse put(Glossary glossary);\n\n @Override\n @DELETE\n @Path(\"{locale}\")\n public ClientResponse deleteGlossary(@PathParam(\"locale\") LocaleId locale);\n\n @Override\n @DELETE\n public ClientResponse deleteGlossaries();\n\n}\n","new_contents":"package org.zanata.rest.client;\n\nimport javax.ws.rs.Consumes;\nimport javax.ws.rs.DELETE;\nimport javax.ws.rs.GET;\nimport javax.ws.rs.PUT;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.PathParam;\nimport javax.ws.rs.Produces;\n\nimport org.jboss.resteasy.client.ClientResponse;\nimport org.zanata.common.LocaleId;\nimport org.zanata.rest.MediaTypes;\nimport org.zanata.rest.dto.Glossary;\nimport org.zanata.rest.service.GlossaryResource;\n\n@Produces({ MediaTypes.APPLICATION_ZANATA_GLOSSARY_XML, MediaTypes.APPLICATION_ZANATA_GLOSSARY_JSON })\n@Consumes({ MediaTypes.APPLICATION_ZANATA_GLOSSARY_XML, MediaTypes.APPLICATION_ZANATA_GLOSSARY_JSON })\npublic interface IGlossaryResource extends GlossaryResource\n{\n public static final String SERVICE_PATH = \"\/glossary\";\n\n @Override\n @GET\n public ClientResponse getEntries();\n\n @Override\n @GET\n @Path(\"{locale}\")\n public ClientResponse get(@PathParam(\"locale\") LocaleId locale);\n\n @Override\n @PUT\n public ClientResponse put(Glossary glossary);\n\n @Override\n @DELETE\n @Path(\"{locale}\")\n public ClientResponse deleteGlossary(@PathParam(\"locale\") LocaleId locale);\n\n @Override\n @DELETE\n public ClientResponse deleteGlossaries();\n\n}\n","subject":"Fix GlossaryTerm with TermComment relationship and test"} {"old_contents":"package com.michaldabski.panoramio.requests;\n\nimport com.android.volley.Response;\n\n\/**\n * Created by Michal on 10\/08\/2014.\n *\/\npublic class NearbyPhotosRequest extends PanoramioRequest\n{\n public static final int NUM_PHOTOS = 30;\n private static final float\n LAT_MULTIPLIER = 0.4f,\n LON_MULTIPLIER = 1f;\n private final float userLat, userLong;\n\n public NearbyPhotosRequest(Response.ErrorListener listener, float latitude, float longitude, int from, int to, float distance)\n {\n super(listener, longitude-(distance* LON_MULTIPLIER), latitude-(distance* LAT_MULTIPLIER), longitude+(distance*LON_MULTIPLIER), latitude+(distance*LAT_MULTIPLIER), from, to);\n userLat = latitude;\n userLong = longitude;\n }\n\n public NearbyPhotosRequest(Response.ErrorListener listener, float latitude, float longitude, int from, float distance)\n {\n this(listener, latitude, longitude, from, from+NUM_PHOTOS, distance);\n }\n\n}\n","new_contents":"package com.michaldabski.panoramio.requests;\n\nimport com.android.volley.Response;\n\n\/**\n * Created by Michal on 10\/08\/2014.\n *\/\npublic class NearbyPhotosRequest extends PanoramioRequest\n{\n public static final int NUM_PHOTOS = 50;\n private static final float\n LAT_MULTIPLIER = 0.4f,\n LON_MULTIPLIER = 1f;\n private final float userLat, userLong;\n\n public NearbyPhotosRequest(Response.ErrorListener listener, float latitude, float longitude, int from, int to, float distance)\n {\n super(listener, longitude-(distance* LON_MULTIPLIER), latitude-(distance* LAT_MULTIPLIER), longitude+(distance*LON_MULTIPLIER), latitude+(distance*LAT_MULTIPLIER), from, to);\n userLat = latitude;\n userLong = longitude;\n }\n\n public NearbyPhotosRequest(Response.ErrorListener listener, float latitude, float longitude, int from, float distance)\n {\n this(listener, latitude, longitude, from, from+NUM_PHOTOS, distance);\n }\n\n}\n","subject":"Increase number of photos downloaded to 50 at once"} {"old_contents":"\/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\/\n\npackage com.facebook.react.uimanager;\n\nimport javax.annotation.Nullable;\n\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.facebook.react.bridge.UiThreadUtil;\n\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\npublic class ViewHierarchyDumper {\n\n public static @Nullable JSONObject toJSON(@Nullable View view) {\n UiThreadUtil.assertOnUiThread();\n if (view == null) {\n return null;\n }\n JSONObject result = new JSONObject();\n try {\n result.put(\"class\", view.getClass().getSimpleName());\n Object tag = view.getTag();\n if (tag != null && tag instanceof String) {\n result.put(\"id\", tag);\n }\n if (view instanceof ViewGroup) {\n ViewGroup viewGroup = (ViewGroup) view;\n if (viewGroup.getChildCount() > 0) {\n JSONArray children = new JSONArray();\n for (int i = 0; i < viewGroup.getChildCount(); i++) {\n children.put(i, toJSON(viewGroup.getChildAt(i)));\n }\n result.put(\"children\", children);\n }\n }\n } catch (JSONException ex) {\n return null;\n }\n return result;\n }\n}\n","new_contents":"\/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\/\n\npackage com.facebook.react.uimanager;\n\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.facebook.react.bridge.UiThreadUtil;\n\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\npublic class ViewHierarchyDumper {\n\n public static JSONObject toJSON(View view) throws JSONException {\n UiThreadUtil.assertOnUiThread();\n\n JSONObject result = new JSONObject();\n result.put(\"n\", view.getClass().getName());\n result.put(\"i\", System.identityHashCode(view));\n Object tag = view.getTag();\n if (tag != null && tag instanceof String) {\n result.put(\"t\", tag);\n }\n\n if (view instanceof ViewGroup) {\n ViewGroup viewGroup = (ViewGroup) view;\n if (viewGroup.getChildCount() > 0) {\n JSONArray children = new JSONArray();\n for (int i = 0; i < viewGroup.getChildCount(); i++) {\n children.put(i, toJSON(viewGroup.getChildAt(i)));\n }\n result.put(\"c\", children);\n }\n }\n\n return result;\n }\n}\n","subject":"Add custom error reporter in Groups"} {"old_contents":"package com.camelinaction;\n\nimport javax.inject.Inject;\nimport javax.inject.Singleton;\n\nimport org.apache.camel.Endpoint;\nimport org.apache.camel.builder.RouteBuilder;\nimport org.apache.camel.cdi.Uri;\n\n\/**\n * Camel routes that uses undertow to expose a HTTP service\n *\/\n@Singleton\npublic class HelloRoute extends RouteBuilder {\n\n @Inject @Uri(\"undertow:http:\/\/0.0.0.0:8080\")\n private Endpoint undertow;\n\n @Inject\n private HelloBean hello;\n\n @Override\n public void configure() throws Exception {\n from(undertow).bean(hello);\n }\n}\n","new_contents":"package com.camelinaction;\n\nimport javax.inject.Inject;\nimport javax.inject.Singleton;\n\nimport org.apache.camel.Endpoint;\nimport org.apache.camel.builder.RouteBuilder;\nimport org.apache.camel.cdi.Uri;\n\n\/**\n * Camel routes that uses undertow to expose a HTTP service\n *\/\n@Singleton\npublic class HelloRoute extends RouteBuilder {\n\n @Inject @Uri(\"undertow:http:\/\/0.0.0.0:8080\/\")\n private Endpoint undertow;\n\n @Inject\n private HelloBean hello;\n\n @Override\n public void configure() throws Exception {\n from(undertow).bean(hello);\n }\n}\n","subject":"Add slash as workaround until swarm is upgraded to camel 2.19 onwards"} {"old_contents":"package com.infinityraider.infinitylib.modules.keyboard;\n\nimport com.google.common.collect.ImmutableList;\nimport com.infinityraider.infinitylib.modules.Module;\nimport net.minecraftforge.api.distmarker.Dist;\nimport net.minecraftforge.api.distmarker.OnlyIn;\n\nimport java.util.List;\n\npublic class ModuleKeyboard extends Module {\n private static final ModuleKeyboard INSTANCE = new ModuleKeyboard();\n\n public static ModuleKeyboard getInstance() {\n return INSTANCE;\n }\n\n private ModuleKeyboard() {}\n\n @OnlyIn(Dist.CLIENT)\n public void registerKeyListener(IKeyListener listener) {\n KeyEventHandler.getInstance().registerListener(listener);\n }\n\n @OnlyIn(Dist.CLIENT)\n public boolean isKeyPressed(int key) {\n return KeyEventHandler.getInstance().isKeyPressed(key);\n }\n\n @OnlyIn(Dist.CLIENT)\n public boolean isKeyRepeated(int key) {\n return KeyEventHandler.getInstance().isKeyRepeated(key);\n }\n\n @OnlyIn(Dist.CLIENT)\n public int getKeyHoldDownTime(int key) {\n return KeyEventHandler.getInstance().getKeyHoldDownTime(key);\n }\n\n @OnlyIn(Dist.CLIENT)\n public int getKeyModifier(int key) {\n return KeyEventHandler.getInstance().getKeyModifier(key);\n }\n\n @Override\n @OnlyIn(Dist.CLIENT)\n public List getClientEventHandlers() {\n return ImmutableList.of(KeyEventHandler.getInstance());\n }\n}\n","new_contents":"package com.infinityraider.infinitylib.modules.keyboard;\n\nimport com.google.common.collect.ImmutableList;\nimport com.infinityraider.infinitylib.modules.Module;\nimport net.minecraft.client.settings.KeyBinding;\nimport net.minecraftforge.api.distmarker.Dist;\nimport net.minecraftforge.api.distmarker.OnlyIn;\n\nimport java.util.List;\n\npublic class ModuleKeyboard extends Module {\n private static final ModuleKeyboard INSTANCE = new ModuleKeyboard();\n\n public static ModuleKeyboard getInstance() {\n return INSTANCE;\n }\n\n private ModuleKeyboard() {}\n\n @OnlyIn(Dist.CLIENT)\n public void registerKeyListener(IKeyListener listener) {\n KeyEventHandler.getInstance().registerListener(listener);\n }\n\n @OnlyIn(Dist.CLIENT)\n public boolean isKeyPressed(KeyBinding key) {\n return this.isKeyPressed(key.getKey().getKeyCode());\n }\n\n @OnlyIn(Dist.CLIENT)\n public boolean isKeyPressed(int key) {\n return KeyEventHandler.getInstance().isKeyPressed(key);\n }\n\n @OnlyIn(Dist.CLIENT)\n public boolean isKeyRepeated(int key) {\n return KeyEventHandler.getInstance().isKeyRepeated(key);\n }\n\n @OnlyIn(Dist.CLIENT)\n public int getKeyHoldDownTime(int key) {\n return KeyEventHandler.getInstance().getKeyHoldDownTime(key);\n }\n\n @OnlyIn(Dist.CLIENT)\n public int getKeyModifier(int key) {\n return KeyEventHandler.getInstance().getKeyModifier(key);\n }\n\n @Override\n @OnlyIn(Dist.CLIENT)\n public List getClientEventHandlers() {\n return ImmutableList.of(KeyEventHandler.getInstance());\n }\n}\n","subject":"Add method to Keyboard Module to fetch KeyBinding state"} {"old_contents":"\/*\n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage edu.ames.frc.robot;\n\n\/* List of buttons\/toggles needed\n * Manual pivot toggle: 2\n * Speed boost button: Active joystick push\n * Force shoot button: 4 \n * Force Realign button: 7\n * Stop auto-target toggle: 10\n * Activate frisbee grab button: 8\n * Launch climb procedure: 9 (We need to make it nesscesary to hold, or double\/triple tap the button so as to aviod accidentally starting the climb)\n * \n *\/\npublic class InputManager {\n \n}\n","new_contents":"\/*\n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage edu.ames.frc.robot;\n\n\/* List of buttons\/toggles needed\n * Manual pivot toggle: 2\n * Speed boost button: Active joystick push\n * Force shoot button: 4 \n * Force Realign button: 7\n * Stop auto-target toggle: 10\n * Activate frisbee grab button: 8\n * Launch climb procedure: 9 (We need to make it nesscesary to hold, or double\/triple tap the button so as to aviod accidentally starting the climb)\n * Test Gitttttt\n *\/\npublic class InputManager {\n \n}\n","subject":"Test of the Git system"} {"old_contents":"import vtk.*;\n\npublic class Regression \n{\n public static void main (String []args) \n {\n vtkTesting.Initialize(args);\n\n vtkRenderWindow renWin = new vtkRenderWindow();\n vtkRenderer ren1 = new vtkRenderer();\n renWin.AddRenderer(ren1);\n vtkConeSource cone = new vtkConeSource();\n cone.SetResolution(8);\n vtkPolyDataMapper coneMapper = new vtkPolyDataMapper();\n coneMapper.SetInput(cone.GetOutput());\n\n vtkActor coneActor = new vtkActor();\n coneActor.SetMapper(coneMapper);\n\n ren1.AddActor(coneActor);\n renWin.Render();\n\n vtkTesting.RegressionTestImage(renWin, args);\n }\n}\n\n","new_contents":"\/*=========================================================================\n\n Program: Visualization Toolkit\n Module: Regression.java\n Language: C++\n Date: $Date$\n Version: $Revision$\n\n Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen \n All rights reserved.\n See Copyright.txt or http:\/\/www.kitware.com\/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even \n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR \n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*\/\nimport vtk.*;\n\npublic class Regression \n{\n public static void main (String []args) \n {\n vtkTesting.Initialize(args);\n\n vtkRenderWindow renWin = new vtkRenderWindow();\n vtkRenderer ren1 = new vtkRenderer();\n renWin.AddRenderer(ren1);\n vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();\n iren.SetRenderWindow(renWin);\n vtkConeSource cone = new vtkConeSource();\n cone.SetResolution(8);\n vtkPolyDataMapper coneMapper = new vtkPolyDataMapper();\n coneMapper.SetInput(cone.GetOutput());\n\n vtkActor coneActor = new vtkActor();\n coneActor.SetMapper(coneMapper);\n\n ren1.AddActor(coneActor);\n renWin.Render();\n\n int retVal = vtkTesting.RegressionTestImage(renWin, args, 10);\n if ( retVal == vtkTesting.DO_INTERACTOR )\n {\n iren.Start();\n }\n System.exit(retVal);\n }\n}\n\n","subject":"Send threshold to vtkTesting, add interaction support, and return what vtktesting returns"} {"old_contents":"package com.sakamichi46.model;\n\nimport java.util.Date;\nimport lombok.Getter;\nimport lombok.Setter;\n\n\/**\n *\n * @author kikuta\n *\/\n@Getter @Setter\npublic class Member {\n private String name;\n private Date birthday;\n private String bloodType;\n private String constellation;\n private String profilePhotoUri;\n private String blogUri;\n}\n","new_contents":"package com.sakamichi46.model;\n\nimport com.fasterxml.jackson.annotation.JsonFormat;\nimport java.util.Date;\nimport lombok.Getter;\nimport lombok.Setter;\n\n\/**\n *\n * @author kikuta\n *\/\n@Getter @Setter\npublic class Member {\n private String name;\n @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = \"yyyy-MM-dd\")\n private Date birthday;\n private String bloodType;\n private String constellation;\n private String profilePhotoUri;\n private String blogUri;\n}\n","subject":"Modify date format of json"} {"old_contents":"package org.yi.happy.metric;\n\n\/**\n * I am a simple timer.\n *\/\npublic class SimpleTimer {\n\n \/**\n * create started.\n *\/\n public SimpleTimer() {\n startTime = System.currentTimeMillis();\n stopTime = startTime - 1;\n }\n\n \/**\n * when the timer started.\n *\/\n private long startTime;\n\n \/**\n * when the timer was stopped. (initially: startTime - 1)\n *\/\n private long stopTime;\n\n \/**\n * stop the timer. A timer may only be stopped once.\n *\/\n public void stop() {\n if (stopTime >= startTime) {\n throw new IllegalStateException(\"stop may only be called once\");\n }\n stopTime = System.currentTimeMillis();\n }\n\n \/**\n * get the time on the timer. if the timer has not been stopped get the time\n * from when it was started to now. if the timer has been stopped get the\n * time between when it was started and when it was stopped.\n * \n * @return the elapsed time in ms\n *\/\n public long getTime() {\n if (stopTime < startTime) {\n return System.currentTimeMillis() - startTime;\n }\n return stopTime - startTime;\n }\n}\n","new_contents":"package org.yi.happy.metric;\n\n\/**\n * I am a simple timer.\n *\/\npublic class SimpleTimer {\n\n \/**\n * create started.\n *\/\n public SimpleTimer() {\n startTime = System.currentTimeMillis();\n stopTime = startTime - 1;\n }\n\n \/**\n * when the timer started.\n *\/\n private long startTime;\n\n \/**\n * when the timer was stopped. (initially: startTime - 1)\n *\/\n private long stopTime;\n\n \/**\n * stop the timer. A timer may only be stopped once.\n *\/\n public void stop() {\n if (stopTime >= startTime) {\n throw new IllegalStateException(\"stop may only be called once\");\n }\n stopTime = System.currentTimeMillis();\n }\n\n \/**\n * get the time on the timer. if the timer has not been stopped get the time\n * from when it was started to now. if the timer has been stopped get the\n * time between when it was started and when it was stopped.\n * \n * @return the elapsed time in ms\n *\/\n public long getTime() {\n if (stopTime < startTime) {\n return System.currentTimeMillis() - startTime;\n }\n return stopTime - startTime;\n }\n\n @Override\n public String toString() {\n return \"[\" + getClass().getName() + \": time=\" + getTime() + \" ms]\";\n }\n}\n","subject":"Format simple timers when they are printed."} {"old_contents":"package io.github.duckasteroid.progress.utils;\n\nimport io.github.duckasteroid.progress.ProgressMonitor;\nimport java.io.IOException;\nimport java.io.InputStream;\n\n\/**\n * Wraps an input stream to report 1 unit of work for every byte {@link #read()}.\n * Clients should set the {@link ProgressMonitor#setSize(long)} prior to invoking for this\n * to report correctly.\n * When the stream is {@link #close() closed} the monitor is marked done\n *\/\npublic class InputStreamProgress extends InputStream {\n private final transient InputStream delegate;\n private final transient ProgressMonitor monitor;\n\n public InputStreamProgress(InputStream delegate, ProgressMonitor monitor) {\n this.delegate = delegate;\n this.monitor = monitor;\n }\n\n @Override\n public int read() throws IOException {\n monitor.worked(1);\n return delegate.read();\n }\n\n @Override\n public void close() throws IOException {\n monitor.done();\n super.close();\n }\n}\n","new_contents":"package io.github.duckasteroid.progress.utils;\n\nimport io.github.duckasteroid.progress.ProgressMonitor;\nimport java.io.IOException;\nimport java.io.InputStream;\n\n\/**\n * Wraps an input stream to report 1 unit of work for every byte {@link #read()}.\n * Clients should set the {@link ProgressMonitor#setSize(long)} prior to invoking for this\n * to report correctly.\n * When the stream is {@link #close() closed} the monitor is marked done\n *\/\npublic class InputStreamProgress extends InputStream {\n private final transient InputStream delegate;\n private final transient ProgressMonitor monitor;\n\n public InputStreamProgress(InputStream delegate, ProgressMonitor monitor) {\n this.delegate = delegate;\n this.monitor = monitor;\n }\n\n @Override\n public int read() throws IOException {\n if (monitor.isCancelled()) {\n throw new IOException(\"Read operation cancelled by monitor\");\n }\n monitor.worked(1);\n return delegate.read();\n }\n\n @Override\n public void close() throws IOException {\n monitor.done();\n super.close();\n }\n}\n","subject":"Throw Ex in stream if monitor cancelled"} {"old_contents":"package io.generators.core;\n\nimport javax.annotation.Nonnull;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.Random;\n\nimport static com.google.common.base.Preconditions.checkNotNull;\nimport static com.google.common.collect.ImmutableList.copyOf;\n\n\/**\n * Generates randomly selected element from collection\/array\n *\n * @param type of the collection's elements\n *\n * @author Tomas Klubal\n *\/\npublic class RandomFromCollectionGenerator implements Generator {\n private final List items;\n private final Random random = new Random();\n\n \/**\n * Creates generator that selects values from items<\/code> passed in\n *\n * @param items to select from\n * @throws NullPointerException when collection passed in is null\n *\/\n public RandomFromCollectionGenerator(@Nonnull Collection items) {\n this.items = copyOf(checkNotNull(items, \"Collection for generation can't be null\"));\n }\n\n \/**\n * Creates generator that selects values from items<\/code> passed in\n *\n * @param items to select from\n * @throws NullPointerException when array passed in is null\n *\/\n @SafeVarargs\n public RandomFromCollectionGenerator(T... items) {\n this.items = copyOf(checkNotNull(items, \"Collection for generation can't be null\"));\n }\n\n @Override\n public T next() {\n int maximumIndex = items.size() - 1;\n return maximumIndex > 0\n ? items.get(random.nextInt(maximumIndex))\n : maximumIndex == 0 ? items.get(0) : null;\n }\n}\n","new_contents":"package io.generators.core;\n\nimport javax.annotation.Nonnull;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.Random;\n\nimport static com.google.common.base.Preconditions.checkNotNull;\nimport static com.google.common.collect.ImmutableList.copyOf;\n\n\/**\n * Generates randomly selected element from collection\/array\n *\n * @param type of the collection's elements\n * @author Tomas Klubal\n *\/\npublic class RandomFromCollectionGenerator implements Generator {\n private final List items;\n private final Random random = new Random();\n\n \/**\n * Creates generator that selects values from items<\/code> passed in\n *\n * @param items to select from\n * @throws NullPointerException when collection passed in is null\n *\/\n public RandomFromCollectionGenerator(@Nonnull Collection items) {\n this.items = copyOf(checkNotNull(items, \"Collection for generation can't be null\"));\n }\n\n \/**\n * Creates generator that selects values from items<\/code> passed in\n *\n * @param items to select from\n * @throws NullPointerException when array passed in is null\n *\/\n @SafeVarargs\n public RandomFromCollectionGenerator(T... items) {\n this.items = copyOf(checkNotNull(items, \"Collection for generation can't be null\"));\n }\n\n @Override\n public T next() {\n int maximumIndex = items.size() - 1;\n if (maximumIndex > 0) {\n return items.get(random.nextInt(maximumIndex));\n } else if (maximumIndex == 0) {\n return items.get(0);\n } else {\n return null;\n }\n }\n}\n","subject":"Remove insane double ternary operator"} {"old_contents":"package com.vimeo.networking.utils;\n\nimport com.vimeo.networking.Vimeo;\nimport com.vimeo.networking.model.Privacy;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n\/**\n * Builder for setting privacy params for a video.\n *\n * Created by Mohit Sarveiya on 3\/20\/18.\n *\/\npublic final class PrivacySettingsParams {\n\n private final Map params = new HashMap<>();\n\n public PrivacySettingsParams comments(final Privacy.PrivacyCommentValue privacyCommentValue) {\n params.put(Vimeo.PARAMETER_VIDEO_COMMENTS, privacyCommentValue);\n return this;\n }\n\n public PrivacySettingsParams download(final boolean download) {\n params.put(Vimeo.PARAMETER_VIDEO_DOWNLOAD, download);\n return this;\n }\n\n public PrivacySettingsParams addToCollections(final boolean add) {\n params.put(Vimeo.PARAMETER_VIDEO_DOWNLOAD, add);\n return this;\n }\n\n public PrivacySettingsParams embed(final Privacy.PrivacyEmbedValue privacyEmbedType) {\n params.put(Vimeo.PARAMETER_VIDEO_EMBED, privacyEmbedType);\n return this;\n }\n\n public PrivacySettingsParams view(final Privacy.PrivacyViewValue privacyViewType) {\n params.put(Vimeo.PARAMETER_VIDEO_VIEW, privacyViewType);\n return this;\n }\n\n public Map getParams() {\n return params;\n }\n\n}\n","new_contents":"package com.vimeo.networking.utils;\n\nimport com.vimeo.networking.Vimeo;\nimport com.vimeo.networking.model.Privacy;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n\/**\n * Builder for setting privacy params for a video.\n *\n * Created by Mohit Sarveiya on 3\/20\/18.\n *\/\npublic final class PrivacySettingsParams {\n\n private final Map params = new HashMap<>();\n\n public PrivacySettingsParams comments(final Privacy.PrivacyCommentValue privacyCommentValue) {\n params.put(Vimeo.PARAMETER_VIDEO_COMMENTS, privacyCommentValue);\n return this;\n }\n\n public PrivacySettingsParams download(final boolean download) {\n params.put(Vimeo.PARAMETER_VIDEO_DOWNLOAD, download);\n return this;\n }\n\n public PrivacySettingsParams addToCollections(final boolean add) {\n params.put(Vimeo.PARAMETER_VIDEO_ADD, add);\n return this;\n }\n\n public PrivacySettingsParams embed(final Privacy.PrivacyEmbedValue privacyEmbedType) {\n params.put(Vimeo.PARAMETER_VIDEO_EMBED, privacyEmbedType);\n return this;\n }\n\n public PrivacySettingsParams view(final Privacy.PrivacyViewValue privacyViewType) {\n params.put(Vimeo.PARAMETER_VIDEO_VIEW, privacyViewType);\n return this;\n }\n\n public Map getParams() {\n return params;\n }\n\n}\n","subject":"Fix add to collections bug"} {"old_contents":"package com.aayaffe.sailingracecoursemanager.communication;\n\nimport java.io.Serializable;\n\n\/**\n * Created by aayaffe on 30\/09\/2015.\n *\/\npublic enum ObjectTypes {\n RaceManager(0),\n WorkerBoat(1),\n Buoy(2),\n FlagBuoy(3),\n TomatoBuoy(4),\n TriangleBuoy(5),\n StartLine(6),\n FinishLine(7),\n StartFinishLine(8),\n Gate(9),\n ReferencePoint(10),\n Other(11);\n\n private int value;\n\n ObjectTypes(int value) {\n this.value = value;\n }\n\n public int getValue() {\n return value;\n }\n}\n","new_contents":"package com.aayaffe.sailingracecoursemanager.communication;\n\nimport java.io.Serializable;\n\n\/**\n * Created by aayaffe on 30\/09\/2015.\n *\/\npublic enum ObjectTypes {\n WorkerBoat,\n FlagBuoy,\n TomatoBuoy,\n TriangleBuoy,\n StartLine,\n FinishLine,\n StartFinishLine,\n\n RaceManager, \/\/from here, the relevant ObjectTypes:\n Buoy,\n Gate,\n Satellite,\n ReferencePoint,\n Other\n}\n","subject":"Revert \"Updated object types in Dev\""} {"old_contents":"\/*\n * Copyright (c) Mattia Barbon \n * distributed under the terms of the MIT license\n *\/\n\npackage org.barbon.acash;\n\nimport android.app.Dialog;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\n\nimport android.text.method.LinkMovementMethod;\n\nimport android.widget.TextView;\n\npublic class AboutDialog extends Dialog {\n public AboutDialog(Context context) {\n super(context);\n setTitle(R.string.about_title);\n setContentView(R.layout.about_dialog);\n\n TextView click1 = (TextView) findViewById(R.id.about_clickable_1);\n TextView click2 = (TextView) findViewById(R.id.about_clickable_2);\n\n click1.setMovementMethod(LinkMovementMethod.getInstance());\n click2.setMovementMethod(LinkMovementMethod.getInstance());\n }\n\n public void onBackPressed() {\n \/\/ saves \"displayed_about\" more oft than needed, but it should\n \/\/ not be a problem\n SharedPreferences prefs =\n getContext().getSharedPreferences(\"global\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n\n editor.putBoolean(\"displayed_about\", true);\n editor.commit();\n\n super.onBackPressed();\n }\n\n \/* returns true if the dialog has not been shown yet *\/\n public static boolean showFirstTime(Context context) {\n SharedPreferences prefs =\n context.getSharedPreferences(\"global\", Context.MODE_PRIVATE);\n\n return !prefs.getBoolean(\"displayed_about\", false);\n }\n}\n","new_contents":"\/*\n * Copyright (c) Mattia Barbon \n * distributed under the terms of the MIT license\n *\/\n\npackage org.barbon.acash;\n\nimport android.app.Dialog;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\n\nimport android.text.method.LinkMovementMethod;\n\nimport android.widget.TextView;\n\npublic class AboutDialog extends Dialog {\n public AboutDialog(Context context) {\n super(context);\n setTitle(R.string.about_title);\n setContentView(R.layout.about_dialog);\n\n TextView click1 = (TextView) findViewById(R.id.about_clickable_1);\n TextView click2 = (TextView) findViewById(R.id.about_clickable_2);\n\n click1.setMovementMethod(LinkMovementMethod.getInstance());\n click2.setMovementMethod(LinkMovementMethod.getInstance());\n }\n\n @Override\n public void onBackPressed() {\n \/\/ saves \"displayed_about\" more oft than needed, but it should\n \/\/ not be a problem\n SharedPreferences prefs =\n getContext().getSharedPreferences(\"global\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n\n editor.putBoolean(\"displayed_about\", true);\n editor.commit();\n\n super.onBackPressed();\n }\n\n \/* returns true if the dialog has not been shown yet *\/\n public static boolean showFirstTime(Context context) {\n SharedPreferences prefs =\n context.getSharedPreferences(\"global\", Context.MODE_PRIVATE);\n\n return !prefs.getBoolean(\"displayed_about\", false);\n }\n}\n","subject":"Add the @Override decorator to onBackPressed()."} {"old_contents":"\/*\n * Copyright (C) 2012 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.android.phone;\n\nimport com.android.internal.telephony.DebugService;\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.IBinder;\nimport android.util.Log;\n\nimport java.io.FileDescriptor;\nimport java.io.PrintWriter;\n\n\/**\n * A debug service for telephony.\n *\/\npublic class TelephonyDebugService extends Service {\n private static String TAG = \"TelephonyDebugService\";\n private DebugService mDebugService = new DebugService();\n\n \/** Constructor *\/\n public TelephonyDebugService() {\n Log.d(TAG, \"TelephonyDebugService()\");\n }\n\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public IBinder onBind(Intent intent) {\n return null;\n }\n\n @Override\n protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {\n enforceCallingOrSelfPermission(android.Manifest.permission.DUMP,\n \"Requires DUMP\");\n mDebugService.dump(fd, pw, args);\n }\n}\n\n","new_contents":"\/*\n * Copyright (C) 2012 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.android.phone;\n\nimport com.android.internal.telephony.DebugService;\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.IBinder;\nimport android.util.Log;\n\nimport java.io.FileDescriptor;\nimport java.io.PrintWriter;\n\n\/**\n * A debug service for telephony.\n *\/\npublic class TelephonyDebugService extends Service {\n private static String TAG = \"TelephonyDebugService\";\n private DebugService mDebugService = new DebugService();\n\n \/** Constructor *\/\n public TelephonyDebugService() {\n Log.d(TAG, \"TelephonyDebugService()\");\n }\n\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public IBinder onBind(Intent intent) {\n return null;\n }\n\n @Override\n protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {\n mDebugService.dump(fd, pw, args);\n }\n}\n\n","subject":"Revert \"enforce dump permission on dump()\""} {"old_contents":"\/\/ WikiPathways Java library,\n\/\/ Copyright 2014-2015 WikiPathways\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\/\/\npackage org.wikipathways.client.test.utils;\n\nimport java.net.URL;\n\nimport org.wikipathways.client.WikiPathwaysClient;\n\npublic class ConnectionSettings {\n\n\tpublic static WikiPathwaysClient createClient() throws Exception {\n\/\/\t\tURL url = new URL(\"http:\/\/webservice.wikipathways.org\");\n\t\tURL url = new URL(\"https:\/\/rcbranch.wikipathways.org\/wpi\/webservicetest\");\n\t\treturn new WikiPathwaysClient(url);\n\t}\n}\n","new_contents":"\/\/ WikiPathways Java library,\n\/\/ Copyright 2014-2015 WikiPathways\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\/\/\npackage org.wikipathways.client.test.utils;\n\nimport java.net.URL;\n\nimport org.wikipathways.client.WikiPathwaysClient;\n\npublic class ConnectionSettings {\n\n\tpublic static WikiPathwaysClient createClient() throws Exception {\n\t\tString urlStr = System.getProperty(\"url\", \"https:\/\/rcbranch.wikipathways.org\/wpi\/webservicetest\");\n\/\/\t\tURL url = new URL(\"http:\/\/webservice.wikipathways.org\");\n\t\tURL url = new URL(urlStr);\n\t\treturn new WikiPathwaysClient(url);\n\t}\n}\n","subject":"Make the tested service configurable"} {"old_contents":"package org.mkonrad.fizzbuzz;\n\nimport java.io.PrintStream;\nimport java.util.stream.IntStream;\n\n\/**\n * @author Markus Konrad\n *\/\npublic final class FizzBuzz {\n\n\tprivate final PrintStream printStream;\n\n\tpublic FizzBuzz(PrintStream printStream) {\n\t\tthis.printStream = printStream;\n\t}\n\n\tpublic final void run(int numberOfRounds){\n\t\tif (numberOfRounds < 1) {\n\t\t\tprintStream.println(\"Please specify a positive value for the parameter \\\"numberOfRounds\\\"\");\n\t\t\treturn;\n\t\t}\n IntStream.range(1, numberOfRounds + 1).mapToObj(i ->\t{\n if (i % 3 == 0) {\n if (i % 5 == 0) {\n return \"FizzBuzz\";\n }\n return \"Fizz\";\n }\n if (i % 5 == 0) {\n return \"Buzz\";\n }\n return String.valueOf(i);\n }).forEach(printStream::println);\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew FizzBuzz(System.out).run(100);\n\t}\n}\n","new_contents":"package org.mkonrad.fizzbuzz;\n\nimport java.io.PrintStream;\nimport java.util.stream.IntStream;\n\n\/**\n * @author Markus Konrad\n *\/\npublic final class FizzBuzz {\n\n\tprivate final PrintStream printStream;\n\n\tpublic FizzBuzz(PrintStream printStream) {\n\t\tthis.printStream = printStream;\n\t}\n\n\tpublic final void run(int numberOfRounds){\n\t\tif (numberOfRounds < 1) {\n\t\t\tprintStream.println(\"Please specify a positive value for the parameter \\\"numberOfRounds\\\"\");\n\t\t\treturn;\n\t\t}\n IntStream.range(1, numberOfRounds + 1)\n .mapToObj(i ->\t{\n if (i % 3 == 0) {\n if (i % 5 == 0) {\n return \"FizzBuzz\";\n }\n return \"Fizz\";\n }\n if (i % 5 == 0) {\n return \"Buzz\";\n }\n return String.valueOf(i);\n })\n .forEach(printStream::println);\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew FizzBuzz(System.out).run(100);\n\t}\n}\n","subject":"Migrate implementation to Java 8"} {"old_contents":"package invtweaks.forge.asm;\n\nimport cpw.mods.fml.relauncher.IFMLLoadingPlugin;\n\nimport java.util.Map;\n\n@IFMLLoadingPlugin.TransformerExclusions({\"invtweaks.forge.asm\", \"invtweaks.forge.asm.compatibility\"})\npublic class FMLPlugin implements IFMLLoadingPlugin {\n public static boolean runtimeDeobfEnabled = false;\n\n @Override\n @Deprecated\n public String[] getLibraryRequestClass() {\n return new String[0];\n }\n\n @Override\n public String[] getASMTransformerClass() {\n return new String[]{\/*\"invtweaks.forge.asm.ITAccessTransformer\", *\/\"invtweaks.forge.asm.ContainerTransformer\"};\n }\n\n @Override\n public String getModContainerClass() {\n return null;\n }\n\n @Override\n public String getSetupClass() {\n return null;\n }\n\n @Override\n public void injectData(Map data) {\n runtimeDeobfEnabled = (Boolean)data.get(\"runtimeDeobfuscationEnabled\");\n }\n}\n","new_contents":"package invtweaks.forge.asm;\n\nimport cpw.mods.fml.relauncher.IFMLLoadingPlugin;\n\nimport java.util.Map;\n\n@IFMLLoadingPlugin.TransformerExclusions({\"invtweaks.forge.asm\", \"invtweaks.forge.asm.compatibility\"})\n@IFMLLoadingPlugin.MCVersion(\"\") \/\/ We're using runtime debof integration, so no point in being specific about version\npublic class FMLPlugin implements IFMLLoadingPlugin {\n public static boolean runtimeDeobfEnabled = false;\n\n @Override\n @Deprecated\n public String[] getLibraryRequestClass() {\n return new String[0];\n }\n\n @Override\n public String[] getASMTransformerClass() {\n return new String[]{\/*\"invtweaks.forge.asm.ITAccessTransformer\", *\/\"invtweaks.forge.asm.ContainerTransformer\"};\n }\n\n @Override\n public String getModContainerClass() {\n return null;\n }\n\n @Override\n public String getSetupClass() {\n return null;\n }\n\n @Override\n public void injectData(Map data) {\n runtimeDeobfEnabled = (Boolean)data.get(\"runtimeDeobfuscationEnabled\");\n }\n}\n","subject":"Add blank MCVersion annotation to shut up the FML complant."} {"old_contents":"\/*\n * Copyright 2020, TeamDev. All rights reserved.\n *\n * Redistribution and use in source and\/or binary forms, with or without\n * modification, must retain the above copyright notice and the following\n * disclaimer.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\npackage io.spine.query.given;\n\nimport io.spine.query.CustomColumn;\n\n\/**\n * Custom columns that define entity lifecycle.\n *\n *

      Used in the smoke testing of entity query builders.\n *\/\npublic enum Lifecycle {\n\n ARCHIVED(new ArchivedColumn()),\n\n DELETED(new ArchivedColumn());\n\n private final CustomColumn column;\n\n Lifecycle(CustomColumn column) {\n this.column = column;\n }\n\n \/** Returns the column declaration. *\/\n public CustomColumn column() {\n return column;\n }\n}\n","new_contents":"\/*\n * Copyright 2020, TeamDev. All rights reserved.\n *\n * Redistribution and use in source and\/or binary forms, with or without\n * modification, must retain the above copyright notice and the following\n * disclaimer.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\npackage io.spine.query.given;\n\nimport io.spine.query.CustomColumn;\n\n\/**\n * Custom columns that define entity lifecycle.\n *\n *

      Used in the smoke testing of entity query builders.\n *\/\npublic enum Lifecycle {\n\n ARCHIVED(new ArchivedColumn()),\n\n DELETED(new DeletedColumn());\n\n private final CustomColumn column;\n\n Lifecycle(CustomColumn column) {\n this.column = column;\n }\n\n \/** Returns the column declaration. *\/\n public CustomColumn column() {\n return column;\n }\n}\n","subject":"Use the proper column implementation."} {"old_contents":"\/*\n * Copyright 2013 Prateek Srivastava (@f2prateek)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.f2prateek.couchpotato.tests;\n\nimport android.test.suitebuilder.annotation.SmallTest;\nimport com.f2prateek.couchpotato.ui.activities.MainActivity;\nimport com.squareup.spoon.Spoon;\n\npublic class MainActivityTest extends ActivityTest {\n\n public MainActivityTest() {\n super(MainActivity.class);\n }\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n }\n\n @SmallTest\n public void testUI() {\n Spoon.screenshot(activity, \"Initial_State\");\n }\n}\n","new_contents":"\/*\n * Copyright 2013 Prateek Srivastava (@f2prateek)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.f2prateek.couchpotato.tests;\n\nimport android.app.Instrumentation;\nimport android.content.IntentFilter;\nimport android.test.suitebuilder.annotation.SmallTest;\nimport com.f2prateek.couchpotato.ui.activities.MainActivity;\nimport com.squareup.spoon.Spoon;\n\nimport static org.fest.assertions.api.ANDROID.assertThat;\n\npublic class MainActivityTest extends ActivityTest {\n\n public MainActivityTest() {\n super(MainActivity.class);\n }\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n }\n\n @SmallTest\n public void testStartsActivityWhenNotLoggedIn() {\n IntentFilter filter = new IntentFilter();\n Instrumentation.ActivityMonitor monitor = instrumentation.addMonitor(filter, null, false);\n \/\/ Verify new activity was shown.\n assertThat(monitor).hasHits(1);\n Spoon.screenshot(monitor.getLastActivity(), \"next_activity_shown\");\n }\n}\n","subject":"Test to verify setup activity is shown if not logged in"} {"old_contents":"package tv.rocketbeans.supermafiosi;\n\npublic interface Config {\n\n\tString APP_NAME = \"Super Mafiosi (#beansjam edition)\";\n\tfloat MUSIC_VOLUME = 1.0f;\n\tboolean DEBUG = true;\n\tint MAXIMUM_POINTS = 10;\n}\n","new_contents":"package tv.rocketbeans.supermafiosi;\n\npublic interface Config {\n\n\tString APP_NAME = \"Super Mafiosi (#beansjam edition)\";\n\tfloat MUSIC_VOLUME = 1.0f;\n\tboolean DEBUG = false;\n\tint MAXIMUM_POINTS = 10;\n}\n","subject":"Set debug to false again"} {"old_contents":"package semantics.model;\n\nimport com.google.gson.JsonElement;\nimport java.util.Arrays;\nimport semantics.KnowBase;\nimport semantics.Util;\n\n\npublic abstract class Binary extends Conceptual implements Cloneable {\n private final Conceptual[] cs;\n\n public Binary(Conceptual[] cs) {\n this.cs = cs;\n }\n\n protected abstract Binary construct(Conceptual[] cs);\n\n protected abstract String getTag();\n protected abstract String getOperator();\n\n public void checkSignature(KnowBase kb) {\n for (Conceptual c : cs) {\n c.checkSignature(kb);\n }\n }\n\n public JsonElement toJson() {\n return Util.toTaggedArray(getTag(), Util.allToJson(cs));\n }\n\n\n @Override\n public boolean containsUnknown() {\n for (Conceptual c : cs) {\n if (c.containsUnknown()) {\n return true;\n }\n }\n return false;\n }\n\n @Override\n public Conceptual stripUnknown() {\n if (!containsUnknown()) {\n return this;\n }\n\n Conceptual[] stripped = new Conceptual[cs.length];\n\n for (int i = 0; i < cs.length; ++i) {\n stripped[i] = cs[i].stripUnknown();\n }\n\n return construct(stripped);\n }\n\n\n @Override\n public String toString() {\n return String.format(\"[%s]\", Util.join(\" \" + getOperator() + \" \", cs));\n }\n\n @Override\n public boolean equals(Object o) {\n if (o instanceof Binary) {\n return Arrays.equals(cs, ((Binary) o).cs);\n }\n return false;\n }\n}\n","new_contents":"package semantics.model;\n\nimport com.google.gson.JsonElement;\nimport java.util.Arrays;\nimport semantics.KnowBase;\nimport semantics.Util;\n\n\npublic abstract class Binary extends Conceptual {\n private final Conceptual[] cs;\n\n public Binary(Conceptual[] cs) {\n this.cs = cs;\n }\n\n protected abstract Binary construct(Conceptual[] cs);\n\n protected abstract String getTag();\n protected abstract String getOperator();\n\n public void checkSignature(KnowBase kb) {\n for (Conceptual c : cs) {\n c.checkSignature(kb);\n }\n }\n\n public JsonElement toJson() {\n return Util.toTaggedArray(getTag(), Util.allToJson(cs));\n }\n\n\n @Override\n public boolean containsUnknown() {\n for (Conceptual c : cs) {\n if (c.containsUnknown()) {\n return true;\n }\n }\n return false;\n }\n\n @Override\n public Conceptual stripUnknown() {\n if (!containsUnknown()) {\n return this;\n }\n\n Conceptual[] stripped = new Conceptual[cs.length];\n\n for (int i = 0; i < cs.length; ++i) {\n stripped[i] = cs[i].stripUnknown();\n }\n\n return construct(stripped);\n }\n\n\n @Override\n public String toString() {\n return String.format(\"[%s]\", Util.join(\" \" + getOperator() + \" \", cs));\n }\n\n @Override\n public boolean equals(Object o) {\n if (o instanceof Binary) {\n return Arrays.equals(cs, ((Binary) o).cs);\n }\n return false;\n }\n}\n","subject":"Remove rogue Cloneable interface implementation"} {"old_contents":"package edu.northwestern.bioinformatics.studycalendar.domain;\n\nimport javax.persistence.Entity;\nimport javax.persistence.DiscriminatorValue;\nimport javax.persistence.Transient;\n\n\n\/**\n * @author Nataliya Shurupova\n *\/\n\n@Entity\n@DiscriminatorValue(value=\"2\")\npublic class DayOfTheWeek extends Holiday {\n private String dayOfTheWeek;\n\n @Transient\n public String getDisplayName() {\n return getDayOfTheWeek();\n }\n\n @Transient\n public int getDayOfTheWeekInteger() {\n return mapDayNameToInteger(getDayOfTheWeek());\n }\n\n public String getDayOfTheWeek() {\n return this.dayOfTheWeek;\n }\n\n public void setDayOfTheWeek(String dayOfTheWeek) {\n this.dayOfTheWeek = dayOfTheWeek;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n DayOfTheWeek that = (DayOfTheWeek) o;\n\n if (dayOfTheWeek != null ? !dayOfTheWeek.equals(that.dayOfTheWeek) : that.dayOfTheWeek != null)\n return false;\n\n return true;\n }\n\n @Override\n public String toString(){\n StringBuffer sb = new StringBuffer();\n sb.append(\"Id = \");\n sb.append(getId());\n sb.append(\" DayOfTheWeek = \");\n sb.append(getDayOfTheWeek());\n sb.append(super.toString());\n return sb.toString();\n }\n}\n\n\n","new_contents":"package edu.northwestern.bioinformatics.studycalendar.domain;\n\nimport javax.persistence.Entity;\nimport javax.persistence.DiscriminatorValue;\nimport javax.persistence.Transient;\n\n\n\/**\n * @author Nataliya Shurupova\n *\/\n\n@Entity\n@DiscriminatorValue(value=\"2\")\npublic class DayOfTheWeek extends Holiday {\n \/\/ TODO: This ought to be the java.util.Calendar constant for the day, or a custom enum\n private String dayOfTheWeek;\n\n @Transient\n public String getDisplayName() {\n return getDayOfTheWeek();\n }\n\n @Transient\n public int getDayOfTheWeekInteger() {\n return mapDayNameToInteger(getDayOfTheWeek());\n }\n\n public String getDayOfTheWeek() {\n return this.dayOfTheWeek;\n }\n\n public void setDayOfTheWeek(String dayOfTheWeek) {\n this.dayOfTheWeek = dayOfTheWeek;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n DayOfTheWeek that = (DayOfTheWeek) o;\n\n if (dayOfTheWeek != null ? !dayOfTheWeek.equals(that.dayOfTheWeek) : that.dayOfTheWeek != null)\n return false;\n\n return true;\n }\n\n @Override\n public String toString(){\n StringBuffer sb = new StringBuffer();\n sb.append(\"Id = \");\n sb.append(getId());\n sb.append(\" DayOfTheWeek = \");\n sb.append(getDayOfTheWeek());\n sb.append(super.toString());\n return sb.toString();\n }\n}\n\n\n","subject":"Add TODO about using an enum instead of an unconstrained string"} {"old_contents":"package org.codehaus.modello.plugin;\n\n\/*\n * LICENSE\n *\/\n\nimport java.io.Reader;\nimport java.util.Properties;\n\nimport org.codehaus.modello.Model;\nimport org.codehaus.modello.ModelloException;\n\n\/**\n * @author Trygve Laugstøl<\/a>\n * @version $Id$\n *\/\npublic interface ModelloTranslator\n{\n Model translate( Reader reader, Properties parameters )\n throws ModelloException;\n}\n","new_contents":"package org.codehaus.modello.plugin;\n\n\/*\n * LICENSE\n *\/\n\nimport java.io.Reader;\nimport java.util.Properties;\n\nimport org.codehaus.modello.Model;\nimport org.codehaus.modello.ModelloException;\n\n\/**\n * @author Trygve Laugstøl<\/a>\n * @version $Id$\n *\/\npublic interface ModelloTranslator\n{\n Model translate( Reader reader, Properties parameters )\n throws ModelloException;\n\n void translate( Model model, Properties parameters )\n throws ModelloException;\n}\n","subject":"Add translator method from Model"} {"old_contents":"package com.veyndan.hermes.database;\n\nimport android.database.sqlite.SQLiteDatabase;\n\nimport com.squareup.sqlbrite.BriteDatabase;\nimport com.veyndan.hermes.home.model.Comic;\n\nimport java.util.List;\n\npublic class Db {\n\n public static void insert(BriteDatabase db, List comics) {\n BriteDatabase.Transaction transaction = db.newTransaction();\n try {\n for (Comic comic: comics) {\n db.insert(Comic.TABLE, comic.toContentValues(), SQLiteDatabase.CONFLICT_IGNORE);\n }\n transaction.markSuccessful();\n } finally {\n transaction.end();\n }\n }\n\n}\n","new_contents":"package com.veyndan.hermes.database;\n\nimport com.squareup.sqlbrite.BriteDatabase;\nimport com.veyndan.hermes.home.model.Comic;\n\nimport java.util.List;\n\npublic class Db {\n\n public static void insert(BriteDatabase db, List comics) {\n BriteDatabase.Transaction transaction = db.newTransaction();\n try {\n for (Comic comic: comics) {\n db.insert(Comic.TABLE, comic.toContentValues());\n }\n transaction.markSuccessful();\n } finally {\n transaction.end();\n }\n }\n\n}\n","subject":"Throw error on insertion conflict instead of ignoring it"} {"old_contents":"package net.tropicraft.core.common.dimension.layer;\n\nimport net.minecraft.world.gen.INoiseRandom;\nimport net.minecraft.world.gen.layer.traits.IC0Transformer;\n\npublic final class TropicraftAddSubBiomesLayer implements IC0Transformer {\n\tfinal int baseID;\n\tfinal int[] subBiomeIDs;\n\n\tTropicraftAddSubBiomesLayer(final int baseID, final int[] subBiomeIDs) {\n\t\tthis.baseID = baseID;\n\t\tthis.subBiomeIDs = subBiomeIDs;\n\t}\n\n\tpublic static TropicraftAddSubBiomesLayer rainforest(TropicraftBiomeIds biomeIds) {\n\t\treturn new TropicraftAddSubBiomesLayer(biomeIds.rainforestPlains, new int[] { biomeIds.rainforestHills, biomeIds.rainforestMountains });\n\t}\n\n\t@Override\n\tpublic int apply(INoiseRandom random, int center) {\n\t\tif (center == baseID) {\n\t\t\treturn subBiomeIDs[random.random(subBiomeIDs.length)];\n\t\t} else {\n\t\t\treturn center;\n\t\t}\n\t}\n}\n","new_contents":"package net.tropicraft.core.common.dimension.layer;\n\nimport net.minecraft.world.gen.INoiseRandom;\nimport net.minecraft.world.gen.layer.traits.IC0Transformer;\n\npublic final class TropicraftAddSubBiomesLayer implements IC0Transformer {\n\tfinal int baseID;\n\tfinal int[] subBiomeIDs;\n\n\tTropicraftAddSubBiomesLayer(final int baseID, final int[] subBiomeIDs) {\n\t\tthis.baseID = baseID;\n\t\tthis.subBiomeIDs = subBiomeIDs;\n\t}\n\n\tpublic static TropicraftAddSubBiomesLayer rainforest(TropicraftBiomeIds biomeIds) {\n\t\treturn new TropicraftAddSubBiomesLayer(biomeIds.rainforestPlains, new int[] { biomeIds.rainforestPlains, biomeIds.rainforestHills, biomeIds.rainforestMountains });\n\t}\n\n\t@Override\n\tpublic int apply(INoiseRandom random, int center) {\n\t\tif (center == baseID) {\n\t\t\treturn subBiomeIDs[random.random(subBiomeIDs.length)];\n\t\t} else {\n\t\t\treturn center;\n\t\t}\n\t}\n}\n","subject":"Fix Rainforest Plains not being generated"} {"old_contents":"\/*\r\n * Licensed under MIT (https:\/\/github.com\/ligoj\/ligoj\/blob\/master\/LICENSE)\r\n *\/\r\npackage org.ligoj.bootstrap.model.system;\r\n\r\nimport javax.persistence.Entity;\r\nimport javax.persistence.Table;\r\nimport javax.persistence.UniqueConstraint;\r\n\r\nimport lombok.Getter;\r\nimport lombok.Setter;\r\n\r\n\/**\r\n * System configuration. The name property corresponds to the key.\r\n *\/\r\n@Entity\r\n@Table(name = \"S_CONFIGURATION\", uniqueConstraints = @UniqueConstraint(columnNames = \"name\"))\r\n@Getter\r\n@Setter\r\npublic class SystemConfiguration extends AbstractNamedValue {\r\n\r\n\t\/**\r\n\t * SID\r\n\t *\/\r\n\tprivate static final long serialVersionUID = 1L;\r\n\r\n\t\/\/ Nothing\r\n\r\n}\r\n","new_contents":"\/*\r\n * Licensed under MIT (https:\/\/github.com\/ligoj\/ligoj\/blob\/master\/LICENSE)\r\n *\/\r\npackage org.ligoj.bootstrap.model.system;\r\n\r\nimport javax.persistence.Entity;\r\nimport javax.persistence.Table;\r\nimport javax.persistence.UniqueConstraint;\r\nimport javax.validation.constraints.NotBlank;\r\nimport javax.validation.constraints.NotNull;\r\nimport javax.validation.constraints.Size;\r\n\r\nimport org.ligoj.bootstrap.core.model.AbstractNamedAuditedEntity;\r\n\r\nimport lombok.Getter;\r\nimport lombok.Setter;\r\n\r\n\/**\r\n * System configuration. The name property corresponds to the key.\r\n *\/\r\n@Entity\r\n@Table(name = \"S_CONFIGURATION\", uniqueConstraints = @UniqueConstraint(columnNames = \"name\"))\r\n@Getter\r\n@Setter\r\npublic class SystemConfiguration extends AbstractNamedAuditedEntity {\r\n\r\n\t\/**\r\n\t * SID\r\n\t *\/\r\n\tprivate static final long serialVersionUID = 1L;\r\n\r\n\t\/**\r\n\t * Value as string.\r\n\t *\/\r\n\t@NotBlank\r\n\t@NotNull\r\n\t@Size(max = 8192)\r\n\tprivate String value;\r\n\r\n}\r\n","subject":"Update configuration value size to 8K"} {"old_contents":"package edu.agh.tunev.ui.plot;\n\nimport java.beans.PropertyVetoException;\n\nimport javax.swing.JInternalFrame;\nimport javax.swing.SwingUtilities;\n\npublic abstract class AbstractPlot extends JInternalFrame {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\t\/**\n\t * Nazwa wykresu w UI.\n\t *\/\n\tpublic static String PLOT_NAME;\n\n\tpublic AbstractPlot(int modelNumber, String modelName, int plotNumber,\n\t\t\tClass subclass) {\n\t\tString name = null;\n\t\ttry {\n\t\t\tname = (String) subclass.getDeclaredField(\"PLOT_NAME\").get(this);\n\t\t} catch (IllegalArgumentException | IllegalAccessException\n\t\t\t\t| NoSuchFieldException | SecurityException e1) {\n\t\t}\n\n\t\tsetTitle(modelNumber + \": \" + modelName + \" - \" + plotNumber + \": \"\n\t\t\t\t+ name);\n\t\tsetSize(400, 300);\n\t\tsetLocation(modelNumber * 20 + 400 + (plotNumber - 1) * 20, modelNumber\n\t\t\t\t* 20 + (plotNumber - 1) * 20);\n\t\tsetFrameIcon(null);\n\t\tsetResizable(true);\n\t\tsetClosable(true);\n\t\tsetDefaultCloseOperation(DISPOSE_ON_CLOSE);\n\t\tsetVisible(true);\n\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tAbstractPlot.this.setSelected(true);\n\t\t\t\t} catch (PropertyVetoException e) {\n\t\t\t\t\tAbstractPlot.this.toFront();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n}\n","new_contents":"package edu.agh.tunev.ui.plot;\n\nimport java.beans.PropertyVetoException;\n\nimport javax.swing.JInternalFrame;\nimport javax.swing.SwingUtilities;\n\npublic abstract class AbstractPlot extends JInternalFrame {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\t\/**\n\t * Nazwa wykresu w UI.\n\t *\/\n\tpublic static String PLOT_NAME;\n\n\tpublic AbstractPlot(int modelNumber, String modelName, int plotNumber,\n\t\t\tClass subclass) {\n\t\tString name = null;\n\t\ttry {\n\t\t\tname = (String) subclass.getDeclaredField(\"PLOT_NAME\").get(this);\n\t\t} catch (IllegalArgumentException | IllegalAccessException\n\t\t\t\t| NoSuchFieldException | SecurityException e1) {\n\t\t}\n\n\t\tsetTitle(modelNumber + \": \" + modelName + \" - \" + plotNumber + \": \"\n\t\t\t\t+ name);\n\t\tsetSize(400, 300);\n\t\tsetLocation(modelNumber * 20 + 400 + 20 + plotNumber * 20, modelNumber\n\t\t\t\t* 20 + 20 + plotNumber * 20);\n\t\tsetFrameIcon(null);\n\t\tsetResizable(true);\n\t\tsetClosable(true);\n\t\tsetDefaultCloseOperation(DISPOSE_ON_CLOSE);\n\t\tsetVisible(true);\n\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tAbstractPlot.this.setSelected(true);\n\t\t\t\t} catch (PropertyVetoException e) {\n\t\t\t\t\tAbstractPlot.this.toFront();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n}\n","subject":"Move default position of plot slightly (would cover visualization)"} {"old_contents":"package guitests;\n\nimport static org.junit.Assert.assertTrue;\n\nimport org.junit.Test;\n\nimport seedu.address.logic.commands.UndoCommand;\nimport seedu.address.testutil.TestTask;\nimport seedu.address.logic.commands.DeleteCommand;\n\npublic class UndoCommandTest extends TaskManagerGuiTest {\n\n private TestTask[] expectedList = td.getTypicalTasks();\n\n \/**\n * Tries to undo an add command\n *\/\n @Test\n public void undoAdd() {\n TestTask taskToAdd = td.alice;\n commandBox.runCommand(taskToAdd.getAddCommand());\n assertUndoSuccess(expectedList);\n }\n\n \/**\n * Tries to undo a delete command\n *\/\n @Test\n public void undoDelete() {\n int targetIndex = 1;\n commandBox.runCommand(DeleteCommand.COMMAND_WORD + \" \" + targetIndex);\n\n assertUndoSuccess(expectedList);\n }\n\n private void assertUndoSuccess(TestTask[] expectedList) {\n commandBox.runCommand(UndoCommand.COMMAND_WORD);\n assertTrue(taskListPanel.isListMatching(expectedList));\n assertResultMessage(String.format(UndoCommand.MESSAGE_SUCCESS));\n\n }\n\n}\n\n","new_contents":"package guitests;\n\nimport static org.junit.Assert.assertTrue;\n\nimport org.junit.Test;\n\nimport seedu.address.logic.commands.ClearCommand;\nimport seedu.address.logic.commands.DeleteCommand;\nimport seedu.address.logic.commands.UndoCommand;\nimport seedu.address.testutil.TestTask;\nimport seedu.address.logic.commands.DeleteCommand;\n\npublic class UndoCommandTest extends TaskManagerGuiTest {\n\n private TestTask[] expectedList = td.getTypicalTasks();\n\n \/**\n * Tries to undo an add command\n *\/\n @Test\n public void undoAdd() {\n TestTask taskToAdd = td.alice;\n commandBox.runCommand(taskToAdd.getAddCommand());\n assertUndoSuccess(expectedList);\n }\n\n \/**\n * Tries to undo a delete command\n *\/\n @Test\n public void undoDelete() {\n int targetIndex = 1;\n commandBox.runCommand(DeleteCommand.COMMAND_WORD + \" \" + targetIndex);\n\n assertUndoSuccess(expectedList);\n }\n\n \/**\n * Tries to undo a clear command\n *\/\n @Test\n public void undoClear() {\n commandBox.runCommand(\"mark 1\");\n commandBox.runCommand(\"mark 2\");\n commandBox.runCommand(ClearCommand.COMMAND_WORD + \" done\");\n\n expectedList[0].setStatus(\"done\");\n expectedList[0].setStatus(\"done\");\n assertUndoSuccess(expectedList);\n }\n\n private void assertUndoSuccess(TestTask[] expectedList) {\n commandBox.runCommand(UndoCommand.COMMAND_WORD);\n assertTrue(taskListPanel.isListMatching(expectedList));\n assertResultMessage(String.format(UndoCommand.MESSAGE_SUCCESS));\n\n }\n\n}\n\n","subject":"Add test case for undo clear command"} {"old_contents":"package assignment3;\r\n\r\npublic class LinkedList {\r\n\t\r\n\tprivate Nodes root = null;\r\n\t\r\n\tpublic boolean findNode(Nodes node){\r\n if(node==null) return false;\r\n Nodes currentNode = root;\r\n while(currentNode.getName()!= node.getName())\r\n {\r\n currentNode = currentNode.getNext();\r\n if(currentNode == null)\r\n return false;\r\n }\r\n return true;\r\n }\r\n public void iterate(){\r\n \tSystem.out.println(\"Iterate forward...\");\r\n Nodes temp = root;\r\n while(temp!=null){\r\n \t System.out.println(temp.toString());\r\n \t temp = temp.getNext();\r\n }\r\n \r\n }\r\n}\r\n","new_contents":"package assignment3;\r\n\r\npublic class LinkedList {\r\n\t\r\n\tprivate Nodes root = null;\r\n\t\r\n\tpublic boolean findNode(Nodes node){\r\n if(node==null) return false;\r\n Nodes currentNode = root;\r\n while(currentNode.getName()!= node.getName())\r\n {\r\n currentNode = currentNode.getNext();\r\n if(currentNode == null)\r\n return false;\r\n }\r\n return true;\r\n }\r\n public void iterate(){\r\n \tSystem.out.println(\"Iterate forward...\");\r\n Nodes temp = root;\r\n while(temp!=null){\r\n \t System.out.println(temp.toString());\r\n \t temp = temp.getNext();\r\n }\r\n \r\n }\r\n public boolean remove(Nodes node){\r\n \treturn false;\r\n }\r\n}\r\n","subject":"Add delete a node option"} {"old_contents":"package net.sourceforge.javydreamercsw.mysql.driver;\n\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport java.util.logging.Logger;\nimport org.netbeans.api.db.explorer.DatabaseException;\nimport org.netbeans.api.db.explorer.JDBCDriver;\nimport org.netbeans.api.db.explorer.JDBCDriverManager;\nimport org.openide.modules.ModuleInstall;\nimport org.openide.util.Exceptions;\nimport org.openide.windows.WindowManager;\n\npublic class Installer extends ModuleInstall {\n\n public static final String mysqlDriverClass = \"com.mysql.jdbc.Driver\";\n private static final Logger LOG =\n Logger.getLogger(Installer.class.getCanonicalName());\n\n @Override\n public void restored() {\n WindowManager.getDefault().invokeWhenUIReady(new Runnable() {\n @Override\n public void run() {\n \/\/Check drivers\n if (JDBCDriverManager.getDefault().getDrivers(mysqlDriverClass).length == 0) {\n try {\n LOG.fine(\"Registering MySQL driver!\");\n JDBCDriverManager.getDefault().addDriver(\n JDBCDriver.create(\"mysql\", \"MySQL\",\n mysqlDriverClass,\n new URL[]{new URL(\n \"nbinst:\/modules\/ext\/com.validation.manager.mysql\/1\/mysql\/mysql-connector-java.jar\")}));\n } catch (DatabaseException ex) {\n Exceptions.printStackTrace(ex);\n } catch (MalformedURLException ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n }\n });\n }\n}\n","new_contents":"package net.sourceforge.javydreamercsw.mysql.driver;\n\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport java.util.logging.Logger;\nimport org.netbeans.api.db.explorer.DatabaseException;\nimport org.netbeans.api.db.explorer.JDBCDriver;\nimport org.netbeans.api.db.explorer.JDBCDriverManager;\nimport org.openide.modules.ModuleInstall;\nimport org.openide.util.Exceptions;\nimport org.openide.windows.WindowManager;\n\npublic class Installer extends ModuleInstall {\n\n public static final String DRIVER = \"com.mysql.cj.jdbc.Driver\";\n private static final Logger LOG\n = Logger.getLogger(Installer.class.getCanonicalName());\n\n @Override\n public void restored() {\n WindowManager.getDefault().invokeWhenUIReady(() -> {\n \/\/Check drivers\n if (JDBCDriverManager.getDefault().getDrivers(DRIVER).length == 0) {\n try {\n LOG.fine(\"Registering MySQL driver!\");\n JDBCDriverManager.getDefault().addDriver(\n JDBCDriver.create(\"mysql\", \"MySQL\",\n DRIVER,\n new URL[]{new URL(\n \"nbinst:\/modules\/ext\/com.validation.manager.mysql\/1\/mysql\/mysql-connector-java.jar\")}));\n } catch (DatabaseException | MalformedURLException ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n });\n }\n}\n","subject":"Use correct driver class as the old one is being deprecated."} {"old_contents":"package com.jmonad.seq;\n\nimport org.junit.Test;\n\npublic class SeqDropTest {\n\n private Integer[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};\n private Seq elements = new Seq(numbers);\n\n @Test public void dropListElementsTest() {\n assert elements.drop(5).toArrayList().toString().equals(\"[6, 7, 8, 9, 10]\");\n }\n\n @Test public void dropElementsWithNoAmountTest() {\n assert elements.drop(0).toArrayList().toString().equals(\"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\");\n }\n\n @Test public void dropElementsWithNegativeAmountTest() {\n assert elements.drop(-1).toArrayList().toString().equals(\"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\");\n }\n\n @Test public void dropElementsWithAmountHigherThanListSizeTest() {\n assert elements.drop(20).toArrayList().toString().equals(\"[]\");\n }\n}\n","new_contents":"package com.jmonad.seq;\n\nimport org.junit.Test;\n\npublic class SeqDropTest {\n\n private Integer[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};\n private Seq elements = new Seq<>(numbers);\n\n @Test public void dropListElementsTest() {\n assert elements.drop(5).toArrayList().toString().equals(\"[6, 7, 8, 9, 10]\");\n }\n\n @Test public void dropElementsWithNoAmountTest() {\n assert elements.drop(0).toArrayList().toString().equals(\"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\");\n }\n\n @Test public void dropElementsWithNegativeAmountTest() {\n assert elements.drop(-1).toArrayList().toString().equals(\"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\");\n }\n\n @Test public void dropElementsWithAmountHigherThanListSizeTest() {\n assert elements.drop(20).toArrayList().toString().equals(\"[]\");\n }\n}\n","subject":"Initialize seq without type in drop test class"} {"old_contents":"\/*\n * Licensed to Elasticsearch under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\n\npackage org.elasticsearch.cloud.aws;\n\nimport com.amazonaws.auth.AWSCredentialsProvider;\nimport org.elasticsearch.common.settings.Settings;\nimport org.elasticsearch.test.ESTestCase;\n\npublic class SyspropCredentialsTests extends ESTestCase {\n public void test() {\n AWSCredentialsProvider provider =\n InternalAwsS3Service.buildCredentials(logger, deprecationLogger, Settings.EMPTY, Settings.EMPTY, \"default\");\n \/\/ NOTE: sys props are setup by the test runner in gradle\n assertEquals(\"sysprop_access\", provider.getCredentials().getAWSAccessKeyId());\n assertEquals(\"sysprop_secret\", provider.getCredentials().getAWSSecretKey());\n assertWarnings(\"Supplying S3 credentials through system properties is deprecated\");\n }\n}\n","new_contents":"\/*\n * Licensed to Elasticsearch under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\n\npackage org.elasticsearch.cloud.aws;\n\nimport com.amazonaws.auth.AWSCredentialsProvider;\nimport org.elasticsearch.common.settings.Settings;\nimport org.elasticsearch.test.ESTestCase;\n\npublic class SyspropCredentialsTests extends ESTestCase {\n public void test() {\n AWSCredentialsProvider provider =\n InternalAwsS3Service.buildCredentials(logger, deprecationLogger, Settings.EMPTY, Settings.EMPTY, \"default\");\n \/\/ NOTE: sys props are setup by the test runner in gradle\n assertEquals(\"sysprop_access\", provider.getCredentials().getAWSAccessKeyId());\n assertEquals(\"sysprop_secret\", provider.getCredentials().getAWSSecretKey());\n assertWarnings(\"Supplying S3 credentials through system properties is deprecated. \" +\n \"See the breaking changes lists in the documentation for details.\");\n }\n}\n","subject":"Fix another warning assertion in credentials test"} {"old_contents":"\/*\n * Copyright 2018 ImpactDevelopment\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage clientapi;\n\n\/**\n * Used to track the version of the API. An API version\n * consists of a Major, Minor, and Patch version.\n *\n * @author Brady\n * @since 8\/16\/2017 7:11 PM\n *\/\npublic final class Version {\n\n private Version() {}\n\n \/**\n * Incremented when a new version of Minecraft is released, never reset\n *\/\n public static final int MAJOR = 3;\n\n \/**\n * Incremented when API-breaking changes are made, reset when major version is modified\n *\/\n public static final int MINOR = 0;\n\n \/**\n * Incremented every release, reset when the minor version is modified\n *\/\n public static final int PATCH = 0;\n\n \/**\n * @return The version formatted as {@code MAJOR.MINOR.PATCH}\n *\/\n public static String getVersion() {\n return String.format(\"%d.%d.%d\", MAJOR, MINOR, PATCH);\n }\n}\n","new_contents":"\/*\n * Copyright 2018 ImpactDevelopment\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage clientapi;\n\n\/**\n * Used to track the version of the API. An API version\n * consists of a Major, Minor, and Patch version.\n *\n * @author Brady\n * @since 8\/16\/2017 7:11 PM\n *\/\npublic final class Version {\n\n private Version() {}\n\n \/**\n * Incremented when a new version of Minecraft is released, never reset\n *\/\n public static final int MAJOR = 3;\n\n \/**\n * Incremented when API-breaking changes are made, reset when major version is modified\n *\/\n public static final int MINOR = 0;\n\n \/**\n * Incremented every release, reset when the minor version is modified\n *\/\n public static final int PATCH = 1;\n\n \/**\n * @return The version formatted as {@code MAJOR.MINOR.PATCH}\n *\/\n public static String getVersion() {\n return String.format(\"%d.%d.%d\", MAJOR, MINOR, PATCH);\n }\n}\n","subject":"Update the version to 3.0.1"} {"old_contents":"package de.fhdw.wipbank.server.model;\n\nimport java.math.BigDecimal;\nimport java.util.Date;\n\nimport javax.xml.bind.annotation.XmlRootElement;\nimport javax.xml.bind.annotation.XmlTransient;\n\nimport com.sun.jmx.snmp.Timestamp;\n\n@XmlRootElement\npublic class Transaction {\n private int id;\n private Account sender;\n private Account receiver;\n private BigDecimal amount;\n private String reference;\n private Timestamp transactionDate; \/\/ siehe Schnittstellen\/Aufrufbeispiele -> Timestamp: \"transactionDate\" : \"2016-03-11T17:08:14+0100\"\n\n @XmlTransient\n public int getId() {\n return id;\n }\n\n public void setId(int id) {\n this.id = id;\n }\n\n public Account getSender() {\n return sender;\n }\n\n public void setSender(Account sender) {\n this.sender = sender;\n }\n\n public Account getReceiver() {\n return receiver;\n }\n\n public void setReceiver(Account receiver) {\n this.receiver = receiver;\n }\n\n public BigDecimal getAmount() {\n return amount;\n }\n\n public void setAmount(BigDecimal amount) {\n this.amount = amount;\n }\n\n public String getReference() {\n return reference;\n }\n\n public void setReference(String reference) {\n this.reference = reference;\n }\n\n public Timestamp getTransactionDate() {\n return transactionDate;\n }\n\n public void setTransactionDate(Timestamp transactionDate) {\n this.transactionDate = transactionDate;\n }\n\n}\n","new_contents":"package de.fhdw.wipbank.server.model;\n\nimport java.math.BigDecimal;\nimport java.util.Date;\n\nimport javax.xml.bind.annotation.XmlRootElement;\nimport javax.xml.bind.annotation.XmlTransient;\n\n@XmlRootElement\npublic class Transaction {\n private int id;\n private Account sender;\n private Account receiver;\n private BigDecimal amount;\n private String reference;\n private Date transactionDate;\n\n @XmlTransient\n public int getId() {\n return id;\n }\n\n public void setId(int id) {\n this.id = id;\n }\n\n public Account getSender() {\n return sender;\n }\n\n public void setSender(Account sender) {\n this.sender = sender;\n }\n\n public Account getReceiver() {\n return receiver;\n }\n\n public void setReceiver(Account receiver) {\n this.receiver = receiver;\n }\n\n public BigDecimal getAmount() {\n return amount;\n }\n\n public void setAmount(BigDecimal amount) {\n this.amount = amount;\n }\n\n public String getReference() {\n return reference;\n }\n\n public void setReference(String reference) {\n this.reference = reference;\n }\n\n public Date getTransactionDate() {\n return transactionDate;\n }\n\n public void setTransactionDate(Date transactionDate) {\n this.transactionDate = transactionDate;\n }\n\n}\n","subject":"Revert \"transactionDate : Date -> Timestamp\""} {"old_contents":"package de.diesner.ehzlogger;\n\nimport java.io.IOException;\nimport java.util.List;\n\nimport gnu.io.PortInUseException;\nimport gnu.io.UnsupportedCommOperationException;\nimport org.openmuc.jsml.structures.*;\nimport org.openmuc.jsml.tl.SML_SerialReceiver;\n\npublic class EhzLogger {\n\n public static void main(String[] args) throws IOException, PortInUseException, UnsupportedCommOperationException {\n System.setProperty(\"gnu.io.rxtx.SerialPorts\", \"\/dev\/ttyUSB0\");\n final SML_SerialReceiver receiver = new SML_SerialReceiver();\n receiver.setupComPort(\"\/dev\/ttyUSB0\");\n\n Runtime.getRuntime().addShutdownHook(new Thread()\n {\n public void run()\n {\n try {\n receiver.close();\n\n } catch (IOException e) {\n System.err.println(\"Error while trying to close serial port: \" + e.getMessage());\n }\n }\n });\n\n CmdLinePrint cmdLinePrint = new CmdLinePrint();\n\n while (true) {\n\n SML_File smlFile = receiver.getSMLFile();\n System.out.println(\"Got SML_File\");\n\n cmdLinePrint.messageReceived(smlFile.getMessages());\n }\n }\n\n}\n","new_contents":"package de.diesner.ehzlogger;\n\nimport java.io.IOException;\nimport java.util.List;\n\nimport gnu.io.PortInUseException;\nimport gnu.io.UnsupportedCommOperationException;\nimport org.openmuc.jsml.structures.*;\nimport org.openmuc.jsml.tl.SML_SerialReceiver;\n\npublic class EhzLogger {\n\n public static void main(String[] args) throws IOException, PortInUseException, UnsupportedCommOperationException {\n System.setProperty(\"gnu.io.rxtx.SerialPorts\", \"\/dev\/ttyUSB0\");\n final SML_SerialReceiver receiver = new SML_SerialReceiver();\n receiver.setupComPort(\"\/dev\/ttyUSB0\");\n\n Runtime.getRuntime().addShutdownHook(new Thread()\n {\n public void run()\n {\n try {\n receiver.close();\n\n } catch (IOException e) {\n System.err.println(\"Error while trying to close serial port: \" + e.getMessage());\n }\n }\n });\n\n SmlForwarder forwarder = new CmdLinePrint();\n\n while (true) {\n\n SML_File smlFile = receiver.getSMLFile();\n System.out.println(\"Got SML_File\");\n\n forwarder.messageReceived(smlFile.getMessages());\n }\n }\n\n}\n","subject":"Use interface in main to access SmlForwarder"} {"old_contents":"import java.io.File;\nimport java.io.IOException;\nimport java.net.InetAddress;\nimport java.util.Random;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.google.common.net.InetAddresses;\nimport com.maxmind.maxminddb.InvalidDatabaseException;\nimport com.maxmind.maxminddb.MaxMindDbReader;\nimport com.maxmind.maxminddb.MaxMindDbReader.FileMode;\n\npublic class Benchmark {\n\n public static void main(String[] args) throws IOException,\n InvalidDatabaseException {\n File file = new File(\"GeoIP2-City.mmdb\");\n\n MaxMindDbReader r = new MaxMindDbReader(file, FileMode.MEMORY_MAPPED);\n Random random = new Random();\n int count = 1000000;\n long startTime = System.nanoTime();\n for (int i = 0; i < count; i++) {\n InetAddress ip = InetAddresses.fromInteger(random.nextInt());\n if (i % 50000 == 0) {\n System.out.println(i + \" \" + ip);\n }\n JsonNode t = r.get(ip);\n }\n long endTime = System.nanoTime();\n\n long duration = endTime - startTime;\n System.out.println(\"Requests per second: \" + count * 1000000000.0\n \/ (duration));\n }\n}\n","new_contents":"import java.io.File;\nimport java.io.IOException;\nimport java.net.InetAddress;\nimport java.util.Random;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.google.common.net.InetAddresses;\nimport com.maxmind.maxminddb.InvalidDatabaseException;\nimport com.maxmind.maxminddb.MaxMindDbReader;\nimport com.maxmind.maxminddb.MaxMindDbReader.FileMode;\n\npublic class Benchmark {\n\n public static void main(String[] args) throws IOException,\n InvalidDatabaseException {\n File file = new File(\"GeoLite2-City.mmdb\");\n\n MaxMindDbReader r = new MaxMindDbReader(file, FileMode.MEMORY_MAPPED);\n Random random = new Random();\n int count = 1000000;\n long startTime = System.nanoTime();\n for (int i = 0; i < count; i++) {\n InetAddress ip = InetAddresses.fromInteger(random.nextInt());\n if (i % 50000 == 0) {\n System.out.println(i + \" \" + ip);\n }\n JsonNode t = r.get(ip);\n }\n long endTime = System.nanoTime();\n\n long duration = endTime - startTime;\n System.out.println(\"Requests per second: \" + count * 1000000000.0\n \/ (duration));\n }\n}\n","subject":"Use GeoLIte2 in benchmark example"} {"old_contents":"package org.gbif.checklistbank.nub.source;\n\nimport org.gbif.api.vocabulary.Rank;\nimport org.gbif.checklistbank.nub.model.SrcUsage;\n\nimport java.util.List;\nimport java.util.UUID;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\npublic class ClasspathUsageSourceTest {\n\n \/**\n * integration test with prod registry\n * @throws Exception\n *\/\n @Test\n public void testListSources() throws Exception {\n ClasspathUsageSource src = ClasspathUsageSource.allSources();\n List sources = src.listSources();\n assertEquals(3, sources.size());\n assertEquals(1, sources.get(0).priority);\n assertEquals(Rank.FAMILY, sources.get(0).ignoreRanksAbove);\n }\n\n @Test\n public void testIterateSource() throws Exception {\n ClasspathUsageSource src = ClasspathUsageSource.emptySource();\n NubSource fungi = new NubSource();\n fungi.name = \"squirrels\";\n fungi.key = UUID.fromString(\"d7dddbf4-2cf0-4f39-9b2a-99b0e2c3aa01\");\n fungi.ignoreRanksAbove = Rank.SPECIES;\n int counter = 0;\n for (SrcUsage u : src.iterateSource(fungi)) {\n counter++;\n System.out.print(u.key + \" \");\n System.out.println(u.scientificName);\n }\n assertEquals(9, counter);\n }\n}","new_contents":"package org.gbif.checklistbank.nub.source;\n\nimport org.gbif.api.vocabulary.Rank;\nimport org.gbif.checklistbank.nub.model.SrcUsage;\n\nimport java.util.List;\nimport java.util.UUID;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\npublic class ClasspathUsageSourceTest {\n\n \/**\n * integration test with prod registry\n * @throws Exception\n *\/\n @Test\n public void testListSources() throws Exception {\n ClasspathUsageSource src = ClasspathUsageSource.allSources();\n List sources = src.listSources();\n assertEquals(8, sources.size());\n assertEquals(1, sources.get(0).priority);\n assertEquals(Rank.FAMILY, sources.get(0).ignoreRanksAbove);\n }\n\n @Test\n public void testIterateSource() throws Exception {\n ClasspathUsageSource src = ClasspathUsageSource.emptySource();\n NubSource fungi = new NubSource();\n fungi.name = \"squirrels\";\n fungi.key = UUID.fromString(\"d7dddbf4-2cf0-4f39-9b2a-99b0e2c3aa01\");\n fungi.ignoreRanksAbove = Rank.SPECIES;\n int counter = 0;\n for (SrcUsage u : src.iterateSource(fungi)) {\n counter++;\n System.out.print(u.key + \" \");\n System.out.println(u.scientificName);\n }\n assertEquals(9, counter);\n }\n}","subject":"Adjust test outcome to new nub source numbers"} {"old_contents":"package uk.ac.ebi.quickgo.index.annotation.coterms;\n\nimport java.util.Iterator;\nimport org.springframework.batch.item.ItemReader;\n\n\/**\n * @author Tony Wardell\n * Date: 07\/09\/2016\n * Time: 15:38\n * Created with IntelliJ IDEA.\n *\/\nclass Co_occurringTermItemReader implements ItemReader {\n\n private final AnnotationCo_occurringTermsAggregator annotationCoOccurringTermsAggregator;\n private Iterator termsIt;\n\n public Co_occurringTermItemReader(AnnotationCo_occurringTermsAggregator annotationCoOccurringTermsAggregator) {\n this.annotationCoOccurringTermsAggregator = annotationCoOccurringTermsAggregator;\n\n }\n\n @Override public String read() throws Exception {\n if (termsIt == null) {\n termsIt = annotationCoOccurringTermsAggregator.getTermToTermOverlapMatrix().keySet().iterator();\n }\n\n if (termsIt.hasNext()) {\n return termsIt.next();\n }\n\n return null;\n }\n}\n","new_contents":"package uk.ac.ebi.quickgo.index.annotation.coterms;\n\nimport java.util.Iterator;\nimport org.springframework.batch.item.ItemReader;\n\n\/**\n * Provide a list of all GO Terms for which co-occurrence has been determined ( which is all of them that have been\n * processed, since at worst a GO Term will have a statistic for co-occurring with itself).\n *\n * @author Tony Wardell\n * Date: 07\/09\/2016\n * Time: 15:38\n * Created with IntelliJ IDEA.\n *\/\nclass Co_occurringTermItemReader implements ItemReader {\n\n private final AnnotationCo_occurringTermsAggregator aggregator;\n private Iterator termsIt;\n\n public Co_occurringTermItemReader(AnnotationCo_occurringTermsAggregator annotationCoOccurringTermsAggregator) {\n this.aggregator = annotationCoOccurringTermsAggregator;\n\n }\n\n @Override public String read() throws Exception {\n\n \/\/Delay providing full list until aggregator has fully processed all records.\n if (termsIt == null) {\n termsIt = aggregator.getTermToTermOverlapMatrix().keySet().iterator();\n }\n\n if (termsIt.hasNext()) {\n return termsIt.next();\n }\n\n return null;\n }\n}\n","subject":"Add some javadoc, notes and use a nicer name for AnnotationCo_occurringTermsAggregator."} {"old_contents":"public class Main {\n public static void main(String[] args) {\n\n }\n}","new_contents":"import org.apache.commons.cli.*;\n\nimport javax.mail.AuthenticationFailedException;\nimport javax.mail.MessagingException;\nimport javax.mail.Session;\nimport javax.mail.Transport;\nimport java.util.Properties;\n\npublic class Main {\n\n private static String appName = \"malooer\";\n\n \/**\n * Required parameters:\n * -port \n * -host \n * -user \n * -pwd \n *\n * @param args\n *\/\n public static void main(String[] args) {\n HelpFormatter hFormatter = new HelpFormatter();\n CommandLine cl;\n\n if (args.length < 1) {\n hFormatter.printHelp(appName, getOptions());\n return;\n }\n\n try {\n cl = getCommandline(args);\n } catch (ParseException e) {\n hFormatter.printHelp(appName, getOptions());\n return;\n }\n\n Integer port = Integer.valueOf(cl.getOptionValue(\"port\"));\n String host = cl.getOptionValue(\"host\");\n String user = cl.getOptionValue(\"user\");\n String pwd = cl.getOptionValue(\"pwd\");\n\n try {\n Properties props = new Properties();\n props.put(\"mail.smtp.auth\", \"true\");\n\n Session session = Session.getInstance(props);\n\n Transport transport = session.getTransport(\"smtp\");\n transport.connect(host, port, user, pwd);\n transport.close();\n System.out.println(\"Connection established [\" + host + \"]\");\n } catch (AuthenticationFailedException e) {\n System.out.println(\"Authentication failed\");\n } catch (MessagingException e) {\n System.out.println(\"Unable to connect to server\");\n }\n }\n\n private static CommandLine getCommandline(String[] args) throws ParseException {\n Options options = getOptions();\n CommandLineParser clParser = new DefaultParser();\n\n return clParser.parse(options, args);\n }\n\n private static Options getOptions() {\n Options options = new Options();\n\n Option portOption = new Option(\"port\", true, \"port of server\");\n Option hostOption = new Option(\"host\", true, \"the host\");\n Option userOption = new Option(\"user\", true, \"the user\");\n Option passOption = new Option(\"pwd\", true, \"the password\");\n\n options.addOption(portOption);\n options.addOption(hostOption);\n options.addOption(userOption);\n options.addOption(passOption);\n\n return options;\n }\n}","subject":"Establish and close connection to smtp server"} {"old_contents":"\/*\n * Copyright 2011 Matthew Avery, mavery@advancedpwr.com\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.advancedpwr.record.methods;\n\npublic class StringBuilder extends AbstractPrimitiveBuilder\n{\n\t\n\tpublic String resultBuilder()\n\t{\n\t\treturn \"\\\"\" + result().replaceAll( \"\\n\", \"\\\\\\\\n\" ) + \"\\\"\"; \n\t}\n\n\n\n}\n","new_contents":"\/*\n * Copyright 2011 Matthew Avery, mavery@advancedpwr.com\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.advancedpwr.record.methods;\n\npublic class StringBuilder extends AbstractPrimitiveBuilder\n{\n\t\n\tpublic String resultBuilder()\n\t{\n\t\treturn \"\\\"\" + result().replaceAll( \"\\n\", \"\\\\\\\\n\" ).replaceAll( \"\\r\", \"\\\\\\\\r\" ) + \"\\\"\"; \n\t}\n\n\n\n}\n","subject":"Handle newlines when building strings."} {"old_contents":"package net.openhft.chronicle.queue.simple.translator;\n\n\/**\n * Created by catherine on 26\/07\/2016.\n *\/\npublic interface MessageConsumer {\n void onMessage(String text);\n\n void translate(String from, String to);\n}\n","new_contents":"package net.openhft.chronicle.queue.simple.translator;\n\n\/**\n * Created by catherine on 26\/07\/2016.\n *\/\npublic interface MessageConsumer {\n void onMessage(String text);\n\n\/\/ void translate(String from, String to);\n}\n","subject":"Comment un implemented translate method."} {"old_contents":"package de.linkvt.bachelor.features.axioms.classexpression;\n\nimport de.linkvt.bachelor.features.Feature;\nimport de.linkvt.bachelor.features.FeatureCategory;\n\nimport org.semanticweb.owlapi.model.OWLClass;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class OwlAllDisjointClassesFeature extends Feature {\n @Override\n public void addToOntology() {\n OWLClass opera = featurePool.getExclusiveClass(\":Opera\");\n OWLClass operetta = featurePool.getExclusiveClass(\":Operetta\");\n OWLClass musical = featurePool.getExclusiveClass(\":Musical\");\n\n addAxiomToOntology(factory.getOWLDisjointClassesAxiom(opera, operetta, musical));\n }\n\n @Override\n public String getName() {\n return \"owl:AllDistjointClasses\";\n }\n\n @Override\n public String getToken() {\n return \"alldisjointclasses\";\n }\n\n @Override\n public FeatureCategory getCategory() {\n return FeatureCategory.CLASS_EXPRESSION_AXIOMS;\n }\n}\n","new_contents":"package de.linkvt.bachelor.features.axioms.classexpression;\n\nimport de.linkvt.bachelor.features.Feature;\nimport de.linkvt.bachelor.features.FeatureCategory;\n\nimport org.semanticweb.owlapi.model.OWLClass;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class OwlAllDisjointClassesFeature extends Feature {\n @Override\n public void addToOntology() {\n OWLClass opera = featurePool.getExclusiveClass(\":Opera\");\n OWLClass operetta = featurePool.getExclusiveClass(\":Operetta\");\n OWLClass musical = featurePool.getExclusiveClass(\":Musical\");\n\n addAxiomToOntology(factory.getOWLDisjointClassesAxiom(opera, operetta, musical));\n }\n\n @Override\n public String getName() {\n return \"owl:AllDisjointClasses\";\n }\n\n @Override\n public String getToken() {\n return \"alldisjointclasses\";\n }\n\n @Override\n public FeatureCategory getCategory() {\n return FeatureCategory.CLASS_EXPRESSION_AXIOMS;\n }\n}\n","subject":"Fix typo in feature name"} {"old_contents":"package com.uxxu.konashi.lib.action;\n\nimport android.bluetooth.BluetoothGattCharacteristic;\nimport android.bluetooth.BluetoothGattService;\n\nimport com.uxxu.konashi.lib.KonashiErrorType;\n\nimport java.util.UUID;\n\nimport info.izumin.android.bletia.BletiaErrorType;\nimport info.izumin.android.bletia.BletiaException;\nimport info.izumin.android.bletia.action.WriteCharacteristicAction;\nimport info.izumin.android.bletia.wrapper.BluetoothGattWrapper;\n\n\/**\n * Created by izumin on 9\/17\/15.\n *\/\npublic abstract class KonashiWriteCharacteristicAction extends WriteCharacteristicAction {\n\n protected KonashiWriteCharacteristicAction(BluetoothGattCharacteristic characteristic) {\n super(characteristic);\n }\n\n protected KonashiWriteCharacteristicAction(BluetoothGattService service, UUID uuid) {\n this(service.getCharacteristic(uuid));\n }\n\n @Override\n public boolean execute(BluetoothGattWrapper gattWrapper) {\n BletiaErrorType errorType = validate();\n if (errorType == KonashiErrorType.NO_ERROR) {\n setValue();\n return super.execute(gattWrapper);\n } else {\n rejectIfParamsAreInvalid(errorType);\n return false;\n }\n }\n\n protected void rejectIfParamsAreInvalid(BletiaErrorType errorType) {\n getDeferred().reject(new BletiaException(this, errorType));\n }\n\n protected abstract void setValue();\n protected abstract BletiaErrorType validate();\n}\n","new_contents":"package com.uxxu.konashi.lib.action;\n\nimport android.bluetooth.BluetoothGattCharacteristic;\nimport android.bluetooth.BluetoothGattService;\n\nimport com.uxxu.konashi.lib.KonashiErrorType;\n\nimport java.util.UUID;\n\nimport info.izumin.android.bletia.BletiaErrorType;\nimport info.izumin.android.bletia.BletiaException;\nimport info.izumin.android.bletia.action.WriteCharacteristicAction;\nimport info.izumin.android.bletia.wrapper.BluetoothGattWrapper;\n\n\/**\n * Created by izumin on 9\/17\/15.\n *\/\npublic abstract class KonashiWriteCharacteristicAction extends WriteCharacteristicAction {\n\n protected KonashiWriteCharacteristicAction(BluetoothGattCharacteristic characteristic) {\n super(characteristic);\n }\n\n protected KonashiWriteCharacteristicAction(BluetoothGattService service, UUID uuid) {\n this(service.getCharacteristic(uuid));\n }\n\n @Override\n public boolean execute(BluetoothGattWrapper gattWrapper) {\n if (getCharacteristic() != null) {\n rejectIfParamsAreInvalid(KonashiErrorType.UNSUPPORTED_OPERATION);\n return false;\n }\n BletiaErrorType errorType = validate();\n if (errorType == KonashiErrorType.NO_ERROR) {\n setValue();\n return super.execute(gattWrapper);\n } else {\n rejectIfParamsAreInvalid(errorType);\n return false;\n }\n }\n\n protected void rejectIfParamsAreInvalid(BletiaErrorType errorType) {\n getDeferred().reject(new BletiaException(this, errorType));\n }\n\n protected abstract void setValue();\n protected abstract BletiaErrorType validate();\n}\n","subject":"Add null check of BGC at execute() on first"} {"old_contents":"package org.jcodegen.java;\n\n\/**\n * ...\n *\/\n\npublic abstract class LogicBranchBlock> extends ConditionalBlock {\n\n public LogicBranchBlock(final String keyword, final int indentationLevel, final Condition condition) {\n super(keyword, indentationLevel, condition);\n }\n\n protected boolean contentIsSuitableForOneLiner(final boolean moreElses) {\n if (!contentIsAOneLiner())\n return false;\n\n if (!moreElses)\n return true;\n\n return !contentContainsBlock(\"if\");\n }\n\n}\n","new_contents":"package org.jcodegen.java;\n\n\/**\n * ...\n *\/\n\npublic abstract class LogicBranchBlock> extends ConditionalBlock {\n\n private boolean forceBrackets = false;\n\n public LogicBranchBlock(String keyword, int indentationLevel, Condition condition) {\n super(keyword, indentationLevel, condition);\n }\n\n public T forceBrackets(boolean forceBrackets) {\n this.forceBrackets = forceBrackets;\n return getThis();\n }\n\n \/\/ TODO: re-analyse workings of function\n protected boolean contentIsSuitableForOneLiner(boolean moreElses) {\n if (forceBrackets)\n return false;\n\n if (!contentIsAOneLiner())\n return false;\n\n if (!moreElses)\n return true;\n\n return !contentContainsBlock(\"if\");\n }\n\n}\n","subject":"Add option to force brackets on if body"} {"old_contents":"package com.intellij.debugger.streams.ui;\n\nimport com.intellij.debugger.DebuggerContext;\nimport com.intellij.debugger.engine.ContextUtil;\nimport com.intellij.debugger.engine.evaluation.EvaluateException;\nimport com.intellij.debugger.memory.utils.InstanceValueDescriptor;\nimport com.intellij.openapi.project.Project;\nimport com.intellij.psi.JavaPsiFacade;\nimport com.intellij.psi.PsiElementFactory;\nimport com.intellij.psi.PsiExpression;\nimport com.sun.jdi.ObjectReference;\nimport com.sun.jdi.Value;\n\n\/**\n * @author Vitaliy.Bibaev\n *\/\npublic class PrimitiveValueDescriptor extends InstanceValueDescriptor {\n PrimitiveValueDescriptor(Project project, Value value) {\n super(project, value);\n }\n\n @Override\n public String calcValueName() {\n final Value value = getValue();\n if (value instanceof ObjectReference) {\n return super.calcValueName();\n }\n\n return value.toString();\n }\n\n @Override\n public PsiExpression getDescriptorEvaluation(DebuggerContext debuggerContext) throws EvaluateException {\n final Value value = getValue();\n if (value instanceof ObjectReference) {\n return super.getDescriptorEvaluation(debuggerContext);\n }\n\n final PsiElementFactory elementFactory = JavaPsiFacade.getInstance(myProject).getElementFactory();\n return elementFactory.createExpressionFromText(\"\", ContextUtil.getContextElement(debuggerContext));\n }\n}\n","new_contents":"package com.intellij.debugger.streams.ui;\n\nimport com.intellij.debugger.DebuggerContext;\nimport com.intellij.debugger.engine.ContextUtil;\nimport com.intellij.debugger.engine.evaluation.EvaluateException;\nimport com.intellij.debugger.memory.utils.InstanceValueDescriptor;\nimport com.intellij.openapi.project.Project;\nimport com.intellij.psi.JavaPsiFacade;\nimport com.intellij.psi.PsiElementFactory;\nimport com.intellij.psi.PsiExpression;\nimport com.sun.jdi.ObjectReference;\nimport com.sun.jdi.Value;\nimport org.jetbrains.annotations.NotNull;\n\n\/**\n * @author Vitaliy.Bibaev\n *\/\npublic class PrimitiveValueDescriptor extends InstanceValueDescriptor {\n PrimitiveValueDescriptor(@NotNull Project project, @NotNull Value value) {\n super(project, value);\n }\n\n @Override\n public String calcValueName() {\n final Value value = getValue();\n if (value instanceof ObjectReference) {\n return super.calcValueName();\n }\n\n return value.type().name();\n }\n\n @Override\n public boolean isShowIdLabel() {\n return true;\n }\n\n @Override\n public PsiExpression getDescriptorEvaluation(DebuggerContext debuggerContext) throws EvaluateException {\n final Value value = getValue();\n if (value instanceof ObjectReference) {\n return super.getDescriptorEvaluation(debuggerContext);\n }\n\n final PsiElementFactory elementFactory = JavaPsiFacade.getInstance(myProject).getElementFactory();\n return elementFactory.createExpressionFromText(\"\", ContextUtil.getContextElement(debuggerContext));\n }\n}\n","subject":"Change presentation for primitive values in collection view"} {"old_contents":"package com.github.peterpaul.cli.instantiator;\n\nimport com.github.peterpaul.cli.fn.ExceptionCatchingSupplier;\nimport com.github.peterpaul.cli.fn.Supplier;\n\npublic class ByServiceLoaderOrNewClassInstanceInstantiator implements Instantiator {\n private final ClassInstantiator classInstantiator = new ClassInstantiator();\n private final ServiceLoaderInstantiator serviceLoaderInstantiator = new ServiceLoaderInstantiator();\n\n @Override\n public T instantiate(Class aClass) {\n return ExceptionCatchingSupplier.catchingFor(new Supplier() {\n @Override\n public T supply() {\n return serviceLoaderInstantiator.instantiate(aClass);\n }\n }).supply().orElseGet(new java.util.function.Supplier() {\n @Override\n public T get() {\n return classInstantiator.instantiate(aClass);\n }\n });\n }\n}\n","new_contents":"package com.github.peterpaul.cli.instantiator;\n\nimport static com.github.peterpaul.cli.fn.ExceptionCatchingSupplier.catchingFor;\n\npublic class ByServiceLoaderOrNewClassInstanceInstantiator implements Instantiator {\n private final ClassInstantiator classInstantiator = new ClassInstantiator();\n private final ServiceLoaderInstantiator serviceLoaderInstantiator = new ServiceLoaderInstantiator();\n\n @Override\n public T instantiate(Class aClass) {\n return catchingFor(() -> serviceLoaderInstantiator.instantiate(aClass))\n .supply()\n .orElseGet(() -> classInstantiator.instantiate(aClass));\n }\n}\n","subject":"Replace anonymous instances with lambdas."} {"old_contents":"package mytown.entities;\r\n\r\npublic class AdminTown extends Town {\r\n public AdminTown(String name) {\r\n super(name);\r\n }\r\n\r\n \/\/ TODO: Finish this up\r\n \/\/ TODO: Add checks for some commands so that people don't try to add stuff to it.\r\n @Override\r\n public void addBlock(TownBlock townBlock) {\r\n blocks.put(townBlock.getKey(), townBlock);\r\n \/\/ TODO: To be edited when checking distance between towns.\r\n }\r\n\r\n @Override\r\n public int getMaxBlocks() {\r\n return 1000;\r\n }\r\n}","new_contents":"package mytown.entities;\r\n\r\npublic class AdminTown extends Town {\r\n public AdminTown(String name) {\r\n super(name);\r\n }\r\n\r\n \/\/ TODO: Finish this up\r\n \/\/ TODO: Add checks for some commands so that people don't try to add stuff to it.\r\n @Override\r\n public void addBlock(TownBlock townBlock) {\r\n blocks.put(townBlock.getKey(), townBlock);\r\n \/\/ TODO: To be edited when checking distance between towns.\r\n }\r\n\r\n @Override\r\n public int getMaxBlocks() {\r\n return Integer.MAX_VALUE;\r\n }\r\n}\r\n","subject":"Remove limit of 1000 blocks for Admin Towns."} {"old_contents":"import java.awt.Component;\nimport java.awt.image.BufferedImage;\n\nimport javax.swing.ImageIcon;\nimport javax.swing.JLabel;\nimport javax.swing.JList;\nimport javax.swing.ListCellRenderer;\n\n@SuppressWarnings(\"unused\")\npublic class PairingListCellRenderer implements ListCellRenderer {\n\t\n\t@Override\n\tpublic Component getListCellRendererComponent(JList list, Pairing value, int index, boolean isSelected, boolean cellHasFocus) {\n\t\t\n\t\tString latex = \"?\";\n\t\t\n\t\tif (value != null) {\n\t\t\t\n\t\t\tString type = value.getVariableExpression().getType().toString();\n\t\t\t\n\t\t\tif (value.isPaired()) {\n\t\t\t\t\/\/make a copy of the expression so that any selections can be removed,\n\t\t\t\t\/\/otherwise the selected subexpression will show as highlighted in the pairings list.\n\t\t\t\tExpression copy = value.getPairedExpression().duplicate();\n\t\t\t\tcopy.deselectRecursive();\n\t\t\t\tlatex = type + \" \" + value.getVariableExpression().toLatex() + \" \\\\leftarrow \" + copy.toLatex();\n\t\t\t\t\/\/latex = value.getVariableExpression().toLatex() + \" \\\\leftarrow \" + value.getPairedExpression().toLatex();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlatex = type + \" \" + value.getVariableExpression().toLatex() + \" \\\\textrm{ is unpaired}\";\n\t\t\t}\n\t\t\t\n\t\t\tif (isSelected) {\n\t latex = \"\\\\bgcolor{\" + LookAndFeel.SELECTED_LATEX_COLOR + \"}{\" + latex + \"}\";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new JLabel(new ImageIcon(LatexHandler.latexToImage(latex)));\n\t}\n}","new_contents":"import java.awt.Component;\nimport javax.swing.ImageIcon;\nimport javax.swing.JLabel;\nimport javax.swing.JList;\nimport javax.swing.ListCellRenderer;\n\npublic class PairingListCellRenderer implements ListCellRenderer {\n\t\n\t@Override\n\tpublic Component getListCellRendererComponent(JList list, Pairing value, int index, boolean isSelected, boolean cellHasFocus) {\n\t\t\n\t\tString latex = \"?\";\n\t\t\n\t\tif (value != null) {\n\t\t\t\n\t\t\tString type = value.getVariableExpression().getType().toString();\n\t\t\t\n\t\t\tif (value.isPaired()) {\n\t\t\t\t\/\/make a copy of the expression so that any selections can be removed,\n\t\t\t\t\/\/otherwise the selected subexpression will show as highlighted in the pairings list.\n\t\t\t\tExpression copy = value.getPairedExpression().duplicate();\n\t\t\t\tcopy.deselectRecursive();\n\t\t\t\tlatex = String.format(\"\\\\textrm{%s } %s \\\\leftarrow %s\",\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tvalue.getVariableExpression().toLatex(),\n\t\t\t\t\t\tcopy.toLatex());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlatex = String.format(\"\\\\textrm{%s } %s \\\\textrm{ is unpaired}\",\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tvalue.getVariableExpression().toLatex());\n\t\t\t}\n\t\t\t\n\t\t\tif (isSelected)\n\t latex = String.format(\"\\\\bgcolor{%s}{%s}\",\n\t \t\tLookAndFeel.SELECTED_LATEX_COLOR,\n\t \t\tlatex);\n\t\t}\n\t\t\n\t\treturn new JLabel(new ImageIcon(LatexHandler.latexToImage(latex)));\n\t}\n}","subject":"Improve output for Pairing lists"} {"old_contents":"\/*\n * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\n *\n * This program and the accompanying materials are made available under the\n * terms of the Eclipse Public License v1.0 which accompanies this distribution,\n * and is available at http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *\/\npackage org.opendaylight.controller.sal.common.util;\n\npublic final class Arguments {\n\n private Arguments() {\n throw new UnsupportedOperationException(\"Utility class\");\n }\n\n \/**\n * Checks if value is instance of provided class\n *\n *\n * @param value Value to check\n * @param type Type to check\n * @return Reference which was checked\n *\/\n @SuppressWarnings(\"unchecked\")\n public static T checkInstanceOf(Object value, Class type) {\n if(!type.isInstance(value))\n throw new IllegalArgumentException(String.format(\"Value %s is not of type %s\", value, type));\n return (T) value;\n }\n}\n","new_contents":"\/*\n * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\n *\n * This program and the accompanying materials are made available under the\n * terms of the Eclipse Public License v1.0 which accompanies this distribution,\n * and is available at http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *\/\npackage org.opendaylight.controller.sal.common.util;\n\npublic final class Arguments {\n\n private Arguments() {\n throw new UnsupportedOperationException(\"Utility class\");\n }\n\n \/**\n * Checks if value is instance of provided class\n *\n *\n * @param value Value to check\n * @param type Type to check\n * @return Reference which was checked\n *\/\n @SuppressWarnings(\"unchecked\")\n public static T checkInstanceOf(Object value, Class type) {\n if(!type.isInstance(value)) {\n throw new IllegalArgumentException(String.format(\"Value %s is not of type %s\", value, type));\n }\n return (T) value;\n }\n}\n","subject":"Fix checkstyle if-statements must use braces sal-common-util"} {"old_contents":"package org.helioviewer.jhv.plugins.swek.sources.hek;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Properties;\n\nimport org.helioviewer.jhv.plugins.swek.SWEKPlugin;\n\n\/**\n * Gives access to the HEK source properties\n * \n * @author Bram Bourgoignie (Bram.Bourgoignie@oma.be)\n * \n *\/\npublic class HEKSourceProperties {\n private static HEKSourceProperties singletonInstance;\n\n \/** The HEK source properties *\/\n private final Properties hekSourceProperties;\n\n \/**\n * Private default constructor.\n *\/\n private HEKSourceProperties() {\n this.hekSourceProperties = new Properties();\n loadProperties();\n }\n\n \/**\n * Gets the singleton instance of the HEK source properties\n * \n * @return the HEK source properties\n *\/\n public static HEKSourceProperties getSingletonInstance() {\n if (singletonInstance == null) {\n singletonInstance = new HEKSourceProperties();\n }\n return singletonInstance;\n }\n\n \/**\n * Gets the HEK source properties.\n * \n * @return the hek source properties\n *\/\n public Properties getHEKSourceProperties() {\n return this.hekSourceProperties;\n }\n\n \/**\n * Loads the overall hek source settings.\n *\/\n private void loadProperties() {\n InputStream defaultPropStream = SWEKPlugin.class.getResourceAsStream(\"\/heksource.properties\");\n try {\n this.hekSourceProperties.load(defaultPropStream);\n } catch (IOException ex) {\n System.out.println(\"Could not load the hek settings.\" + ex);\n }\n }\n\n}\n","new_contents":"package org.helioviewer.jhv.plugins.swek.sources.hek;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Properties;\n\n\/**\n * Gives access to the HEK source properties\n * \n * @author Bram Bourgoignie (Bram.Bourgoignie@oma.be)\n * \n *\/\npublic class HEKSourceProperties {\n private static HEKSourceProperties singletonInstance;\n\n \/** The HEK source properties *\/\n private final Properties hekSourceProperties;\n\n \/**\n * Private default constructor.\n *\/\n private HEKSourceProperties() {\n hekSourceProperties = new Properties();\n loadProperties();\n }\n\n \/**\n * Gets the singleton instance of the HEK source properties\n * \n * @return the HEK source properties\n *\/\n public static HEKSourceProperties getSingletonInstance() {\n if (singletonInstance == null) {\n singletonInstance = new HEKSourceProperties();\n }\n return singletonInstance;\n }\n\n \/**\n * Gets the HEK source properties.\n * \n * @return the hek source properties\n *\/\n public Properties getHEKSourceProperties() {\n return hekSourceProperties;\n }\n\n \/**\n * Loads the overall hek source settings.\n *\/\n private void loadProperties() {\n InputStream defaultPropStream = HEKSourceProperties.class.getResourceAsStream(\"\/heksource.properties\");\n try {\n hekSourceProperties.load(defaultPropStream);\n } catch (IOException ex) {\n System.out.println(\"Could not load the hek settings.\" + ex);\n }\n }\n\n}\n","subject":"Load the properties from via the correct Class otherwise it is not in the class loader"} {"old_contents":"package com.mjrichardson.teamCity.buildTriggers.MachineAdded;\n\nimport org.testng.Assert;\nimport org.testng.annotations.Test;\n\n@Test\npublic class MachineAddedSpecTest {\n\/\/ public void can_create_requestor_string_when_version_not_supplied() {\n\/\/ MachineAddedSpec sut = new MachineAddedSpec(\"theurl\", \"theproject\");\n\/\/ Assert.assertEquals(sut.getRequestorString(), \"Machine of project theproject created on theurl\");\n\/\/ }\n\n public void can_create_requestor_string() {\n Machine machine = new Machine(\"the-machine-id\", \"the-machine-name\");\n MachineAddedSpec sut = new MachineAddedSpec(\"theurl\", machine);\n Assert.assertEquals(sut.getRequestorString(), \"Machine the-machine-name added to theurl\");\n }\n\n public void to_string_converts_correctly() {\n String[] environmentIds = new String[2];\n environmentIds[0] = \"env-1\";\n environmentIds[1] = \"env-22\";\n String[] roleIds = new String[2];\n roleIds[0] = \"role-one\";\n roleIds[1] = \"role-two\";\n Machine machine = new Machine(\"machine-id\", \"machine-name\", environmentIds, roleIds);\n MachineAddedSpec sut = new MachineAddedSpec(\"the-url\", machine);\n String result = sut.toString();\n Assert.assertEquals(result, \"{ url: 'the-url', machineName: 'machine-name', machineId: 'machine-id', environmentIds: 'env-1,env-22', roleIds: 'role-one,role-two' }\");\n }\n}\n","new_contents":"package com.mjrichardson.teamCity.buildTriggers.MachineAdded;\n\nimport org.testng.Assert;\nimport org.testng.annotations.Test;\n\n@Test\npublic class MachineAddedSpecTest {\n public void can_create_requestor_string() {\n Machine machine = new Machine(\"the-machine-id\", \"the-machine-name\");\n MachineAddedSpec sut = new MachineAddedSpec(\"theurl\", machine);\n Assert.assertEquals(sut.getRequestorString(), \"Machine the-machine-name added to theurl\");\n }\n\n public void to_string_converts_correctly() {\n String[] environmentIds = new String[2];\n environmentIds[0] = \"env-1\";\n environmentIds[1] = \"env-22\";\n String[] roleIds = new String[2];\n roleIds[0] = \"role-one\";\n roleIds[1] = \"role-two\";\n Machine machine = new Machine(\"machine-id\", \"machine-name\", environmentIds, roleIds);\n MachineAddedSpec sut = new MachineAddedSpec(\"the-url\", machine);\n String result = sut.toString();\n Assert.assertEquals(result, \"{ url: 'the-url', machineName: 'machine-name', machineId: 'machine-id', environmentIds: 'env-1,env-22', roleIds: 'role-one,role-two' }\");\n }\n}\n","subject":"Remove some commented out code - not required"} {"old_contents":"package io.cattle.platform.docker.process.lock;\n\nimport io.cattle.platform.core.model.StoragePool;\nimport io.cattle.platform.lock.definition.AbstractBlockingLockDefintion;\n\npublic class DockerStoragePoolVolumeCreateLock extends AbstractBlockingLockDefintion {\n\n public DockerStoragePoolVolumeCreateLock(StoragePool storagePool, String volumeUri) {\n super(String.format(\"DOCKER.STORAGE_POOL.VOLUME.CREATE.%s.%s\", storagePool.getId(), volumeUri));\n }\n\n}\n","new_contents":"package io.cattle.platform.docker.process.lock;\n\nimport io.cattle.platform.core.model.StoragePool;\nimport io.cattle.platform.lock.definition.AbstractBlockingLockDefintion;\n\npublic class DockerStoragePoolVolumeCreateLock extends AbstractBlockingLockDefintion {\n\n public DockerStoragePoolVolumeCreateLock(StoragePool storagePool, String volumeUri) {\n super(String.format(\"DOCKER.STORAGE_POOL.VOLUME.CREATE.%s.%s\", storagePool.getId(), volumeUri == null ? 0 : volumeUri.hashCode()));\n }\n\n}\n","subject":"Fix bad characters in lock name"} {"old_contents":"\/*\n * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\n *\n * This program and the accompanying materials are made available under the\n * terms of the Eclipse Public License v1.0 which accompanies this distribution,\n * and is available at http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *\/\n\npackage org.opendaylight.controller.netconf.confignetconfconnector.osgi;\n\nimport org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;\n\nimport javax.annotation.concurrent.GuardedBy;\n\npublic class YangStoreServiceImpl implements YangStoreService {\n private final SchemaContextProvider service;\n @GuardedBy(\"this\")\n private YangStoreSnapshotImpl cache = null;\n\n public YangStoreServiceImpl(SchemaContextProvider service) {\n this.service = service;\n }\n\n @Override\n public synchronized YangStoreSnapshotImpl getYangStoreSnapshot() throws YangStoreException {\n if (cache == null) {\n cache = new YangStoreSnapshotImpl(service.getSchemaContext());\n }\n return cache;\n }\n\n \/**\n * Called when schema context changes, invalidates cache.\n *\/\n public synchronized void refresh() {\n cache = null;\n }\n}\n","new_contents":"\/*\n * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\n *\n * This program and the accompanying materials are made available under the\n * terms of the Eclipse Public License v1.0 which accompanies this distribution,\n * and is available at http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *\/\n\npackage org.opendaylight.controller.netconf.confignetconfconnector.osgi;\n\nimport java.lang.ref.SoftReference;\nimport org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;\n\nimport javax.annotation.concurrent.GuardedBy;\n\npublic class YangStoreServiceImpl implements YangStoreService {\n private final SchemaContextProvider service;\n @GuardedBy(\"this\")\n private SoftReference cache = new SoftReference<>(null);\n\n public YangStoreServiceImpl(SchemaContextProvider service) {\n this.service = service;\n }\n\n @Override\n public synchronized YangStoreSnapshotImpl getYangStoreSnapshot() throws YangStoreException {\n YangStoreSnapshotImpl yangStoreSnapshot = cache.get();\n if (yangStoreSnapshot == null) {\n yangStoreSnapshot = new YangStoreSnapshotImpl(service.getSchemaContext());\n cache = new SoftReference<>(yangStoreSnapshot);\n }\n return yangStoreSnapshot;\n }\n\n \/**\n * Called when schema context changes, invalidates cache.\n *\/\n public synchronized void refresh() {\n cache.clear();\n }\n}\n","subject":"Store yang store snapshot cache using soft reference."} {"old_contents":"package com.playlist;\n\nimport net.sf.json.JSONObject;\nimport org.apache.http.client.methods.CloseableHttpResponse;\nimport org.apache.http.client.methods.HttpPost;\nimport org.apache.http.entity.StringEntity;\nimport org.apache.http.impl.client.CloseableHttpClient;\nimport org.apache.http.impl.client.HttpClients;\nimport org.apache.http.util.EntityUtils;\n\n\/**\n * Helper class for posting to the pre-configured Slack Incoming Webhook Integration URL.\n *\/\npublic class SlackClient {\n\n private String slackWebHookUrl = System.getenv(\"SLACK_WEBHOOK_URL\");\n\n public void postMessageToSlack(String message) throws Exception {\n CloseableHttpClient httpClient = HttpClients.createDefault();\n\n try {\n HttpPost httpPost = new HttpPost(slackWebHookUrl);\n\n JSONObject json = new JSONObject();\n json.put(\"text\", message);\n json.put(\"channel\", \"#test-integrations\");\/\/TODO: remove channel override\n\n StringEntity entity = new StringEntity(json.toString());\n\n httpPost.setEntity(entity);\n CloseableHttpResponse response = httpClient.execute(httpPost);\n\n try {\n if(response.getStatusLine().getStatusCode() != 200) {\n throw new Exception(\"Error occurred posting message to slack: \" + EntityUtils.toString(response.getEntity()));\n }\n } finally {\n response.close();\n }\n } finally {\n httpClient.close();\n }\n }\n}\n","new_contents":"package com.playlist;\n\nimport net.sf.json.JSONObject;\nimport org.apache.commons.lang.StringUtils;\nimport org.apache.http.client.methods.CloseableHttpResponse;\nimport org.apache.http.client.methods.HttpPost;\nimport org.apache.http.entity.StringEntity;\nimport org.apache.http.impl.client.CloseableHttpClient;\nimport org.apache.http.impl.client.HttpClients;\nimport org.apache.http.util.EntityUtils;\n\n\/**\n * Helper class for posting to the pre-configured Slack Incoming Webhook Integration URL.\n *\/\npublic class SlackClient {\n\n private String slackWebHookUrl = System.getenv(\"SLACK_WEBHOOK_URL\");\n private String slackChannelOverride = System.getenv(\"SLACK_CHANNEL_OVERRIDE\");\n\n public void postMessageToSlack(String message) throws Exception {\n CloseableHttpClient httpClient = HttpClients.createDefault();\n\n try {\n HttpPost httpPost = new HttpPost(slackWebHookUrl);\n\n JSONObject json = new JSONObject();\n json.put(\"text\", message);\n\n \/\/Include a channel override if one has been provided\n if(!StringUtils.isEmpty(slackChannelOverride)) {\n json.put(\"channel\", slackChannelOverride);\n }\n\n StringEntity entity = new StringEntity(json.toString());\n\n httpPost.setEntity(entity);\n CloseableHttpResponse response = httpClient.execute(httpPost);\n\n try {\n if(response.getStatusLine().getStatusCode() != 200) {\n throw new Exception(\"Error occurred posting message to slack: \" + EntityUtils.toString(response.getEntity()));\n }\n } finally {\n response.close();\n }\n } finally {\n httpClient.close();\n }\n }\n}\n","subject":"Refactor channel override to environment variable."} {"old_contents":"import static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport java.lang.module.ModuleDescriptor;\nimport java.util.Set;\nimport org.junit.jupiter.api.Test;\n\nclass ModulesParseTextBlockDeclarationTest {\n\n @Test\n void parseDeclaration() {\n var descriptor = Bach.Modules.parseDeclaration(\"\"\"\n module foo.bar { \/\/ 3.3-ALPHA\n requires foo.bax; \/\/ @1.3\n requires foo.bay\/*342*\/;\n requires foo.baz; \/\/ 47.11\n }\n \"\"\");\n\n assertEquals(\"foo.bar\", descriptor.name(), descriptor.toString());\n assertEquals(\n ModuleDescriptor.newModule(\"x\")\n .requires(\"foo.bax\")\n .requires(Set.of(), \"foo.bay\", ModuleDescriptor.Version.parse(\"342\"))\n .requires(\"foo.baz\")\n .build()\n .requires(),\n descriptor.requires(),\n descriptor.toString());\n }\n}\n","new_contents":"import static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport java.lang.module.ModuleDescriptor;\nimport java.lang.module.ModuleDescriptor.Version;\nimport java.util.Set;\nimport org.junit.jupiter.api.Test;\n\nclass ModulesParseTextBlockDeclarationTest {\n\n @Test\n void parseDeclaration() {\n var descriptor = Bach.Modules.parseDeclaration(\"\"\"\n module foo.bar {\n requires foo.bax;\n requires foo.bay\/*1*\/;\n requires foo.baz \/* 2.3-ea *\/;\n }\n \"\"\");\n\n assertEquals(\"foo.bar\", descriptor.name(), descriptor.toString());\n assertEquals(\n ModuleDescriptor.newModule(\"x\")\n .requires(\"foo.bax\")\n .requires(Set.of(), \"foo.bay\", Version.parse(\"1\"))\n .requires(Set.of(), \"foo.baz\", Version.parse(\"2.3-ea\"))\n .build()\n .requires(),\n descriptor.requires(),\n descriptor.toString());\n }\n}\n","subject":"Check for spaces being ignored in inline versions"} {"old_contents":"package me.nallar.patched;\r\n\r\nimport net.minecraft.network.TcpConnection;\r\nimport net.minecraft.server.ThreadMinecraftServer;\r\n\r\npublic abstract class PatchTcpReaderThread extends ThreadMinecraftServer {\r\n\tfinal TcpConnection tcpConnection;\r\n\r\n\tpublic PatchTcpReaderThread(TcpConnection tcpConnection, String name) {\r\n\t\tsuper(null, name);\r\n\t\tthis.tcpConnection = tcpConnection;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void run() {\r\n\t\tTcpConnection.field_74471_a.getAndIncrement();\r\n\r\n\t\ttry {\r\n\t\t\twhile (tcpConnection.isRunning()) {\r\n\t\t\t\twhile (true) {\r\n\t\t\t\t\tif (!tcpConnection.readNetworkPacket()) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tsleep(2L);\r\n\t\t\t\t\t\t} catch (InterruptedException ignored) {\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tTcpConnection.field_74471_a.getAndDecrement();\r\n\t\t}\r\n\t}\r\n}\r\n","new_contents":"package me.nallar.patched;\r\n\r\nimport net.minecraft.network.TcpConnection;\r\nimport net.minecraft.server.ThreadMinecraftServer;\r\nimport net.minecraft.util.AxisAlignedBB;\r\n\r\npublic abstract class PatchTcpReaderThread extends ThreadMinecraftServer {\r\n\tfinal TcpConnection tcpConnection;\r\n\r\n\tpublic PatchTcpReaderThread(TcpConnection tcpConnection, String name) {\r\n\t\tsuper(null, name);\r\n\t\tthis.tcpConnection = tcpConnection;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void run() {\r\n\t\tTcpConnection.field_74471_a.getAndIncrement();\r\n\r\n\t\ttry {\r\n\t\t\twhile (tcpConnection.isRunning()) {\r\n\t\t\t\twhile (true) {\r\n\t\t\t\t\tif (!tcpConnection.readNetworkPacket()) {\r\n\t\t\t\t\t\tAxisAlignedBB.getAABBPool().cleanPool();\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tsleep(2L);\r\n\t\t\t\t\t\t} catch (InterruptedException ignored) {\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tTcpConnection.field_74471_a.getAndDecrement();\r\n\t\t}\r\n\t}\r\n}\r\n","subject":"Fix memory leak due to TcpReaderThread AABB pools never being cleared. If you are on build 740 or later it is recommended to update to the latest build"} {"old_contents":"package org.hcjf.layers.query;\n\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.Map;\n\n\/**\n * @author javaito\n * @mail javaito@gmail.com\n *\/\npublic class In extends FieldEvaluator {\n\n public In(String fieldName, Object value) {\n super(fieldName, value);\n }\n\n @Override\n public boolean evaluate(Object object, Query.Consumer consumer) {\n boolean result = false;\n\n try {\n Object fieldValue = consumer.get(object, getFieldName());\n if(Map.class.isAssignableFrom(fieldValue.getClass())) {\n result = ((Map)fieldValue).containsKey(getValue());\n } else if(Collection.class.isAssignableFrom(fieldValue.getClass())) {\n result = ((Collection)fieldValue).contains(getValue());\n } else if(fieldValue.getClass().isArray()) {\n result = Arrays.binarySearch((Object[])fieldValue, getValue()) >= 0;\n } else if(String.class.isAssignableFrom(fieldValue.getClass())) {\n result = ((String)fieldValue).contains(getValue().toString());\n }\n } catch (Exception ex) {\n throw new IllegalArgumentException(\"In evaluator fail\", ex);\n }\n\n return result;\n }\n}\n","new_contents":"package org.hcjf.layers.query;\n\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.Map;\n\n\/**\n * @author javaito\n * @mail javaito@gmail.com\n *\/\npublic class In extends FieldEvaluator {\n\n public In(String fieldName, Object value) {\n super(fieldName, value);\n }\n\n @Override\n public boolean evaluate(Object object, Query.Consumer consumer) {\n boolean result = false;\n\n try {\n Object fieldValue = consumer.get(object, getFieldName());\n if(Map.class.isAssignableFrom(fieldValue.getClass())) {\n result = ((Map)fieldValue).containsKey(getValue());\n } else if(Collection.class.isAssignableFrom(fieldValue.getClass())) {\n result = ((Collection)fieldValue).contains(getValue());\n } else if(fieldValue.getClass().isArray()) {\n result = Arrays.binarySearch((Object[])fieldValue, getValue()) >= 0;\n } else if (Map.class.isAssignableFrom(getValue().getClass())) {\n result = ((Map)getValue()).containsKey(fieldValue);\n } else if(Collection.class.isAssignableFrom(getValue().getClass())) {\n result = ((Collection)getValue()).contains(fieldValue);\n } else if(getValue().getClass().isArray()) {\n result = Arrays.binarySearch((Object[])getValue(), fieldValue) >= 0;\n }\n } catch (Exception ex) {\n throw new IllegalArgumentException(\"In evaluator fail\", ex);\n }\n\n return result;\n }\n}\n","subject":"Resolve in over array values"} {"old_contents":"package JpAws;\r\n\r\nimport com.amazonaws.services.ec2.AmazonEC2;\r\nimport com.amazonaws.services.ec2.AmazonEC2Client;\r\nimport com.amazonaws.services.ec2.model.RunInstancesRequest;\r\nimport datameer.awstasks.aws.ec2.InstanceGroupImpl;\r\nimport java.io.IOException;\r\nimport java.util.concurrent.TimeUnit;\r\n\r\n\/**\r\n * This class is used for spawning groups of workers.\r\n * @author charlesmunger\r\n *\/\r\npublic class WorkerMachines extends Ec2Machine {\r\n private String masterDomainName;\r\n\r\n \/**\r\n * This creates a new workerMachines object, which is a local interface for managing groups of\r\n * workers. \r\n * @param masterDomainName Specifies the hostname of the Master, for the workers to connect\r\n * to. \r\n *\/\r\n public WorkerMachines(String masterDomainName) {\r\n this.masterDomainName = masterDomainName;\r\n }\r\n\r\n @Override\r\n public String[] start(int numWorkers) throws IOException {\r\n AmazonEC2 ec2 = new AmazonEC2Client(PregelAuthenticator.get());\r\n instanceGroup = new InstanceGroupImpl(ec2);\r\n\r\n RunInstancesRequest launchConfiguration = new RunInstancesRequest(Machine.AMIID, numWorkers, numWorkers)\r\n .withKeyName(PregelAuthenticator.get().getPrivateKeyName())\r\n .withInstanceType(\"t1.micro\")\r\n .withSecurityGroupIds(Ec2Machine.SECURITY_GROUP);\r\n System.out.println(launchConfiguration.toString());\r\n \r\n instanceGroup.launch(launchConfiguration, TimeUnit.MINUTES, 5);\r\n WorkerThread runWorker = new WorkerThread(instanceGroup, masterDomainName);\r\n runWorker.start();\r\n\r\n return null;\r\n }\r\n}\r\n","new_contents":"package JpAws;\r\n\r\nimport com.amazonaws.services.ec2.AmazonEC2;\r\nimport com.amazonaws.services.ec2.AmazonEC2Client;\r\nimport com.amazonaws.services.ec2.model.RunInstancesRequest;\r\nimport datameer.awstasks.aws.ec2.InstanceGroupImpl;\r\nimport java.io.IOException;\r\nimport java.util.concurrent.TimeUnit;\r\n\r\n\/**\r\n * This class is used for spawning groups of workers.\r\n * @author charlesmunger\r\n *\/\r\npublic class WorkerMachines extends Ec2Machine {\r\n private String masterDomainName;\r\n\r\n \/**\r\n * This creates a new workerMachines object, which is a local interface for managing groups of\r\n * workers. \r\n * @param masterDomainName Specifies the hostname of the Master, for the workers to connect\r\n * to. \r\n *\/\r\n public WorkerMachines(String masterDomainName) {\r\n this.masterDomainName = masterDomainName;\r\n }\r\n\r\n @Override\r\n public String[] start(int numWorkers) throws IOException {\r\n AmazonEC2 ec2 = new AmazonEC2Client(PregelAuthenticator.get());\r\n instanceGroup = new InstanceGroupImpl(ec2);\r\n\r\n RunInstancesRequest launchConfiguration = new RunInstancesRequest(Machine.AMIID, numWorkers, numWorkers)\r\n .withKeyName(PregelAuthenticator.get().getPrivateKeyName())\r\n .withInstanceType(\"m1.small\")\r\n .withSecurityGroupIds(Ec2Machine.SECURITY_GROUP);\r\n System.out.println(launchConfiguration.toString());\r\n \r\n instanceGroup.launch(launchConfiguration, TimeUnit.MINUTES, 5);\r\n WorkerThread runWorker = new WorkerThread(instanceGroup, masterDomainName);\r\n runWorker.start();\r\n\r\n return null;\r\n }\r\n}\r\n","subject":"Set workers to use m1.small instances."} {"old_contents":"package constant;\n\n\/*\n * Copyright 2015 Taylor Caldwell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npublic enum PlatformId {\n\t \n\t\tNA(\"NA1\", \"na\"),\n\t\tBR(\"BR1\", \"br\"),\n\t\tLAN(\"LA1\", \"lan\"),\n\t\tLAS(\"LA2\", \"las\"),\n\t\tOCE(\"OC1\", \"oce\"),\n\t\tEUNE(\"EUN1\", \"eune\"),\n\t\tEUW(\"EUW1\", \"euw\"),\n\t\tKR(\"KR\", \"kr\"),\n\t\tRU(\"RU\", \"ru\"),\n\t\tTR(\"TR1\", \"tr\");\n\t\t\n\t private String id;\n\t private String name;\n\t \n\t PlatformId(String id, String name) {\n\t this.id = id;\n\t this.name = name;\n\t }\n\n\t public String getId() {\n\t return id;\n\t }\t \n\t \n\t public String getName() {\n\t \treturn name;\n\t }\n}\n","new_contents":"package constant;\n\n\/*\n * Copyright 2015 Taylor Caldwell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npublic enum PlatformId {\n\t \n\t\tNA(\"NA1\", \"na\"),\n\t\tBR(\"BR1\", \"br\"),\n\t\tLAN(\"LA1\", \"lan\"),\n\t\tLAS(\"LA2\", \"las\"),\n\t\tOCE(\"OC1\", \"oce\"),\n\t\tEUNE(\"EUN1\", \"eune\"),\n\t\tEUW(\"EUW1\", \"euw\"),\n\t\tKR(\"KR\", \"kr\"),\n\t\tRU(\"RU\", \"ru\"),\n\t\tTR(\"TR1\", \"tr\"),\n\t\tPBE(\"PBE1\", \"pbe\");\n\t\t\n\t private String id;\n\t private String name;\n\t \n\t PlatformId(String id, String name) {\n\t this.id = id;\n\t this.name = name;\n\t }\n\n\t public String getId() {\n\t return id;\n\t }\t \n\t \n\t public String getName() {\n\t \treturn name;\n\t }\n}\n","subject":"Add PBE support to current-game and featured-games endpoints"} {"old_contents":"package com.ForgeEssentials.coremod;\n\n\/**\n * Kindly do not reference any FE classes outside the coremod package in this\n * class. This is a store room for all String[]s used by the coremod, 99% of\n * stuff is edited here and not in the actual coremod classes.\n *\/\n\npublic class Data\n{\n\n\tprotected static String[]\tlibraries\t\t=\n\t\t\t\t\t\t\t\t\t\t\t\t{ \"mysql-connector-java-bin.jar\", \"H2DB.jar\", \"worldedit-5.4.6-SNAPSHOT.jar\" };\n\tprotected static String[]\tchecksums\t\t=\n\t\t\t\t\t\t\t\t\t\t\t\t{ \"3ae0cff91d7f40d5b4c7cefbbd1eab34025bdc15\", \"32f12e53b4dab80b721525c01d766b95d22129bb\", \"de96549f9c31aa9268f649fc6757e7b68b180549\" };\n\tprotected static String[]\ttransformers\t=\n\t\t\t\t\t\t\t\t\t\t\t\t{ \"com.ForgeEssentials.coremod.transformers.FEPermissionsTransformer\", \"com.ForgeEssentials.coremod.transformers.FEAccessTransformer\", \"com.ForgeEssentials.coremod.transformers.FEeventAdder\" };\n}\n","new_contents":"package com.ForgeEssentials.coremod;\n\n\/**\n * Kindly do not reference any FE classes outside the coremod package in this\n * class. This is a store room for all String[]s used by the coremod, 99% of\n * stuff is edited here and not in the actual coremod classes.\n *\/\n\npublic class Data\n{\n\n\tprotected static String[]\tlibraries\t\t=\n\t\t\t\t\t\t\t\t\t\t\t\t{ \"mysql-connector-java-bin.jar\", \"H2DB.jar\", \"worldedit-5.4.6-SNAPSHOT.jar\", \"Metrics.jar\" };\n\tprotected static String[]\tchecksums\t\t=\n\t\t\t\t\t\t\t\t\t\t\t\t{ \"3ae0cff91d7f40d5b4c7cefbbd1eab34025bdc15\", \"32f12e53b4dab80b721525c01d766b95d22129bb\", \"de96549f9c31aa9268f649fc6757e7b68b180549\", \"47a1fc60cc5a16f0e125ca525daa596fd7ac0c3a\" };\n\tprotected static String[]\ttransformers\t=\n\t\t\t\t\t\t\t\t\t\t\t\t{ \"com.ForgeEssentials.coremod.transformers.FEPermissionsTransformer\", \"com.ForgeEssentials.coremod.transformers.FEAccessTransformer\", \"com.ForgeEssentials.coremod.transformers.FEeventAdder\" };\n}\n","subject":"Add metrics jar to downloader"} {"old_contents":"package sqlancer.tidb.ast;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport sqlancer.ast.SelectBase;\n\npublic class TiDBSelect extends SelectBase implements TiDBExpression {\n\n\tprivate List joinExpressions = Collections.emptyList();\n\n\tpublic void setJoins(List joinExpressions) {\n\t\tthis.joinExpressions = joinExpressions;\n\t}\n\n\tpublic List getJoinExpressions() {\n\t\treturn joinExpressions;\n\t}\n\n}\n","new_contents":"package sqlancer.tidb.ast;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport sqlancer.ast.SelectBase;\n\npublic class TiDBSelect extends SelectBase implements TiDBExpression {\n\n\tprivate List joinExpressions = Collections.emptyList();\n\tprivate TiDBExpression hint;\n\n\tpublic void setJoins(List joinExpressions) {\n\t\tthis.joinExpressions = joinExpressions;\n\t}\n\n\tpublic List getJoinExpressions() {\n\t\treturn joinExpressions;\n\t}\n\t\n\tpublic void setHint(TiDBExpression hint) {\n\t\tthis.hint = hint;\n\t}\n\t\n\tpublic TiDBExpression getHint() {\n\t\treturn hint;\n\t}\n\n}\n","subject":"Add the forgotten setter for the hint in the SELECT class"} {"old_contents":"package com.jstanier;\n\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.Reader;\nimport java.util.List;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\n\nimport com.googlecode.jcsv.CSVStrategy;\nimport com.googlecode.jcsv.reader.CSVReader;\nimport com.googlecode.jcsv.reader.internal.CSVReaderBuilder;\n\n@Component\npublic class InputParser {\n\n @Autowired\n private InputReader inputReader;\n\n public List parseInput(String pathToCsvFile) {\n return parseCsvFile(pathToCsvFile);\n }\n\n private List parseCsvFile(String pathToCsvFile) {\n List csvData = null;\n try {\n Reader reader = inputReader.getInputReader(pathToCsvFile);\n CSVReader csvParser = new CSVReaderBuilder(reader)\n .strategy(CSVStrategy.UK_DEFAULT)\n .entryParser(new TweetToScheduleEntryParser()).build();\n csvData = csvParser.readAll();\n } catch (FileNotFoundException e) {\n exitWithError(\"File not found at \" + pathToCsvFile);\n } catch (IOException e) {\n exitWithError(\"IO exception when reading\" + pathToCsvFile);\n }\n return csvData;\n }\n\n private void exitWithError(String error) {\n System.err.println(error);\n System.exit(1);\n }\n}\n","new_contents":"package com.jstanier;\n\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.Reader;\nimport java.util.List;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\n\nimport com.googlecode.jcsv.CSVStrategy;\nimport com.googlecode.jcsv.reader.CSVReader;\nimport com.googlecode.jcsv.reader.internal.CSVReaderBuilder;\n\n@Component\npublic class InputParser {\n\n @Autowired\n private InputReader inputReader;\n\n public List parseInput(String pathToCsvFile) {\n return parseCsvFile(pathToCsvFile);\n }\n\n private List parseCsvFile(String pathToCsvFile) {\n List csvData = null;\n try {\n Reader reader = inputReader.getInputReader(pathToCsvFile);\n CSVReader csvParser = new CSVReaderBuilder(reader)\n .strategy(CSVStrategy.UK_DEFAULT)\n .entryParser(new TweetToScheduleEntryParser()).build();\n csvData = csvParser.readAll();\n } catch (FileNotFoundException e) {\n exitWithError(\"File not found at \" + pathToCsvFile);\n } catch (IOException e) {\n exitWithError(\"IO exception when reading \" + pathToCsvFile);\n }\n return csvData;\n }\n\n private void exitWithError(String error) {\n System.err.println(error);\n System.exit(1);\n }\n}\n","subject":"Add space at end of error message"} {"old_contents":"import java.io.File;\nimport org.opensim.modeling.*;\n\nclass TestXsensDataReader {\n public static void test_XsensDataReader() {\n\n \/\/ Test creation and population of XsensDataReaderSettings object \n XsensDataReaderSettings settings = new XsensDataReaderSettings();\n ExperimentalSensor nextSensor = new ExperimentalSensor(\"000_00B421AF\",\n \"shank\");\n settings.append_ExperimentalSensors(nextSensor);\n settings.set_trial_prefix(0, \"MT_012005D6_031-\");\n\n \/\/ Test costruct XsensDataReader from a XsensDataReaderSettings object \n XsensDataReader xsensDataReader = new XsensDataReader(settings);\n \/\/ Make sure types returned by the xsensDataReader are usable in Java\n StdMapStringAbstractDataTable tables = xsensDataReader.readData(\"\");\n\n \/\/ Check that custom accessors are available and return usable types\n \/\/ Only spot check of the table is done as actual testing of contents \n \/\/ lives in the C++ tests\n TimeSeriesTableVec3 accelTableTyped = IMUDataReader.getLinearAccelerationsTable(tables);\n assert accelTableTyped.getNumRows() == 3369;\n assert accelTableTyped.getNumColumns() == 1;\n assert accelTableTyped.\n getTableMetaDataString(\"DataRate\").equals(\"100.000000\");\n }\n\n public static void main(String[] args) {\n test_XsensDataReader();\n }\n};\n","new_contents":"import java.io.File;\nimport org.opensim.modeling.*;\n\nclass TestXsensDataReader {\n public static void test_XsensDataReader() {\n\n \/\/ Test creation and population of XsensDataReaderSettings object \n XsensDataReaderSettings settings = new XsensDataReaderSettings();\n ExperimentalSensor nextSensor = new ExperimentalSensor(\"000_00B421AF\",\n \"shank\");\n settings.append_ExperimentalSensors(nextSensor);\n settings.set_trial_prefix(0, \"MT_012005D6_031-\");\n\n \/\/ Test costruct XsensDataReader from a XsensDataReaderSettings object \n XsensDataReader xsensDataReader = new XsensDataReader(settings);\n \/\/ Make sure types returned by the xsensDataReader are usable in Java\n StdMapStringAbstractDataTable tables = xsensDataReader.readSource(\"\");\n\n \/\/ Check that custom accessors are available and return usable types\n \/\/ Only spot check of the table is done as actual testing of contents \n \/\/ lives in the C++ tests\n TimeSeriesTableVec3 accelTableTyped = IMUDataReader.getLinearAccelerationsTable(tables);\n assert accelTableTyped.getNumRows() == 3369;\n assert accelTableTyped.getNumColumns() == 1;\n assert accelTableTyped.\n getTableMetaDataString(\"DataRate\").equals(\"100.000000\");\n }\n\n public static void main(String[] args) {\n test_XsensDataReader();\n }\n};\n","subject":"Fix java test case as well for method rename"} {"old_contents":"\/*\n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage edu.stuy.subsystems;\n\nimport edu.stuy.RobotMap;\nimport edu.wpi.first.wpilibj.Solenoid;\nimport edu.wpi.first.wpilibj.command.Subsystem;\n\n\/**\n *\n * @author Kevin Wang\n *\/\npublic class Tusks extends Subsystem {\n Solenoid solenoidExtend;\n Solenoid solenoidRetract;\n \n \/\/ Put methods for controlling this subsystem\n \/\/ here. Call these from Commands.\n \n public Tusks() {\n solenoidExtend = new Solenoid(2, RobotMap.TUSKS_SOLENOID_EXTEND);\n solenoidRetract = new Solenoid(2, RobotMap.TUSKS_SOLENOID_RETRACT);\n }\n\n public void initDefaultCommand() {\n \/\/ Set the default command for a subsystem here.\n \/\/setDefaultCommand(new MySpecialCommand());\n }\n \n public void extend() {\n solenoidExtend.set(true);\n solenoidRetract.set(false);\n }\n \n public void retract() {\n solenoidRetract.set(true); \n solenoidExtend.set(false);\n }\n\n public boolean isExtended() {\n return solenoidExtend.get();\n }\n}\n","new_contents":"\/*\n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage edu.stuy.subsystems;\n\nimport edu.stuy.RobotMap;\nimport edu.wpi.first.wpilibj.Solenoid;\nimport edu.wpi.first.wpilibj.command.Subsystem;\n\n\/**\n *\n * @author Kevin Wang\n *\/\npublic class Tusks extends Subsystem {\n Solenoid solenoidExtend;\n Solenoid solenoidRetract;\n \n \/\/ Put methods for controlling this subsystem\n \/\/ here. Call these from Commands.\n \n public Tusks() {\n \/\/ In \"2nd\" cRio slot, or 4th physical\n solenoidExtend = new Solenoid(2, RobotMap.TUSKS_SOLENOID_EXTEND);\n solenoidRetract = new Solenoid(2, RobotMap.TUSKS_SOLENOID_RETRACT);\n }\n\n public void initDefaultCommand() {\n \/\/ Set the default command for a subsystem here.\n \/\/setDefaultCommand(new MySpecialCommand());\n }\n \n public void extend() {\n solenoidExtend.set(true);\n solenoidRetract.set(false);\n }\n \n public void retract() {\n solenoidRetract.set(true); \n solenoidExtend.set(false);\n }\n\n public boolean isExtended() {\n return solenoidExtend.get();\n }\n}\n","subject":"Clarify tusks solenoid on slot 2"} {"old_contents":"package nl.ovapi.rid.model;\n\nimport java.util.ArrayList;\n\nimport lombok.Getter;\nimport lombok.NonNull;\n\npublic class Block {\n\n\t@Getter private ArrayList segments;\n\t@Getter private String blockRef;\n\t\n\tpublic Block(String blockRef){\n\t\tsegments = new ArrayList();\n\t\tthis.blockRef = blockRef;\n\t}\n\t\t\n\tpublic void addJourney(Journey journey){\n\t\tif (journey.getBlockRef() != blockRef && !blockRef.equals(journey.getBlockRef())){\n\t\t\tthrow new IllegalArgumentException(\"Journey not part of this block\");\n\t\t}\n\t\tsegments.add(journey);\n\t}\n}\n","new_contents":"package nl.ovapi.rid.model;\n\nimport java.util.ArrayList;\n\nimport lombok.Getter;\nimport lombok.NonNull;\n\npublic class Block {\n\n\t@Getter private ArrayList segments;\n\t@Getter private String blockRef;\n\t\n\tpublic Block(String blockRef){\n\t\tsegments = new ArrayList();\n\t\tthis.blockRef = blockRef;\n\t}\n\t\n\tpublic long getDepartureEpoch(){\n\t\treturn segments.get(0).getDepartureEpoch();\n\t}\n\t\n\tpublic long getEndEpoch(){\n\t\treturn segments.get(segments.size()).getEndEpoch();\n\t}\n\t\t\n\tpublic void addJourney(Journey journey){\n\t\tif (journey.getBlockRef() != blockRef && !blockRef.equals(journey.getBlockRef())){\n\t\t\tthrow new IllegalArgumentException(\"Journey not part of this block\");\n\t\t}\n\t\tsegments.add(journey);\n\t}\n}\n","subject":"Return min\/max time of blocks"} {"old_contents":"package forager.events;\n\nimport java.io.IOException;\n\nimport galileo.event.Event;\nimport galileo.serialization.SerializationInputStream;\nimport galileo.serialization.SerializationOutputStream;\n\npublic class TaskSpec implements Event {\n\n public String[] command;\n\n public TaskSpec(String[] command) {\n this.command = command;\n }\n\n public String toString() {\n String str = \"\";\n for (String s : command) {\n str += s + \" \";\n }\n return str;\n }\n\n @Deserialize\n public TaskSpec(SerializationInputStream in)\n throws IOException {\n int numArgs = in.readInt();\n command = new String[numArgs];\n for (int i = 0; i < numArgs; ++i) {\n command[i] = in.readString();\n }\n }\n\n @Override\n public void serialize(SerializationOutputStream out)\n throws IOException {\n out.writeInt(command.length);\n for (String s : command) {\n out.writeString(s);\n }\n }\n}\n","new_contents":"package forager.events;\n\nimport java.io.IOException;\n\nimport galileo.event.Event;\nimport galileo.serialization.SerializationInputStream;\nimport galileo.serialization.SerializationOutputStream;\n\npublic class TaskSpec implements Event {\n\n public long taskId;\n public String[] command;\n\n public TaskSpec(long taskId, String[] command) {\n this.taskId = taskId;\n this.command = command;\n }\n\n public String toString() {\n String str = \"[\" + taskId + \"] \";\n for (String s : command) {\n str += s + \" \";\n }\n return str;\n }\n\n @Deserialize\n public TaskSpec(SerializationInputStream in)\n throws IOException {\n taskId = in.readLong();\n int numArgs = in.readInt();\n command = new String[numArgs];\n for (int i = 0; i < numArgs; ++i) {\n command[i] = in.readString();\n }\n }\n\n @Override\n public void serialize(SerializationOutputStream out)\n throws IOException {\n out.writeLong(taskId);\n out.writeInt(command.length);\n for (String s : command) {\n out.writeString(s);\n }\n }\n}\n","subject":"Add identifier to task specifications"} {"old_contents":"\/*\n * Copyright (c) 2006 Stephan D. Cote' - All rights reserved.\n * \n * This program and the accompanying materials are made available under the \n * terms of the MIT License which accompanies this distribution, and is \n * available at http:\/\/creativecommons.org\/licenses\/MIT\/\n *\n * Contributors:\n * Stephan D. Cote \n * - Initial API and implementation\n *\/\npackage coyote.dataframe;\n\nimport java.util.Date;\n\nimport coyote.commons.ByteUtil;\n\n\n\/** Type representing a unsigned 64-bit epoch time in milliseconds *\/\npublic class DateType implements FieldType {\n private static final int _size = 8;\n\n private final static String _name = \"DAT\";\n\n\n\n\n public boolean checkType( Object obj ) {\n return obj instanceof Date;\n }\n\n\n\n\n public Object decode( byte[] value ) {\n return ByteUtil.retrieveDate( value, 0 );\n }\n\n\n\n\n public byte[] encode( Object obj ) {\n return ByteUtil.renderDate( (Date)obj );\n }\n\n\n\n\n public String getTypeName() {\n return _name;\n }\n\n\n\n\n public boolean isNumeric() {\n return false;\n }\n\n\n\n\n public int getSize() {\n return _size;\n }\n\n\n\n\n \/**\n * @see coyote.dataframe.FieldType#stringValue(byte[])\n *\/\n @Override\n public String stringValue( byte[] val ) {\n if ( val == null ) {\n return \"\";\n } else {\n Object obj = decode( val );\n if ( obj != null )\n return obj.toString();\n else\n return \"\";\n }\n }\n\n}\n","new_contents":"\/*\n * Copyright (c) 2006 Stephan D. Cote' - All rights reserved.\n * \n * This program and the accompanying materials are made available under the \n * terms of the MIT License which accompanies this distribution, and is \n * available at http:\/\/creativecommons.org\/licenses\/MIT\/\n *\n * Contributors:\n * Stephan D. Cote \n * - Initial API and implementation\n *\/\npackage coyote.dataframe;\n\nimport java.util.Date;\n\nimport coyote.commons.ByteUtil;\n\n\n\/** Type representing a unsigned 64-bit epoch time in milliseconds *\/\npublic class DateType implements FieldType {\n private static final int _size = 8;\n\n private final static String _name = \"DAT\";\n\n\n\n\n public boolean checkType( Object obj ) {\n return obj instanceof Date;\n }\n\n\n\n\n public Object decode( byte[] value ) {\n return ByteUtil.retrieveDate( value, 0 );\n }\n\n\n\n\n public byte[] encode( Object obj ) {\n return ByteUtil.renderDate( (Date)obj );\n }\n\n\n\n\n public String getTypeName() {\n return _name;\n }\n\n\n\n\n public boolean isNumeric() {\n return false;\n }\n\n\n\n\n public int getSize() {\n return _size;\n }\n\n\n\n\n \/**\n * @see coyote.dataframe.FieldType#stringValue(byte[])\n *\/\n @Override\n public String stringValue( byte[] val ) {\n if ( val == null || val.length == 0 ) {\n return \"\";\n } else {\n Object obj = decode( val );\n if ( obj != null )\n return obj.toString();\n else\n return \"\";\n }\n }\n\n}\n","subject":"Check for empty data value"} {"old_contents":"package net.aeten.core;\n\nimport net.aeten.core.event.EventData;\nimport net.aeten.core.event.Handler;\n\n\npublic interface Model> {\n\tvoid addObserver(Handler> observer);\n\tvoid removeObserver(Handler> observer);\n}\n","new_contents":"package net.aeten.core;\n\nimport net.aeten.core.event.EventData;\nimport net.aeten.core.event.Handler;\n\npublic interface Model , F extends Enum > {\n\tvoid addObserver (Handler > observer);\n\n\tvoid removeObserver (Handler > observer);\n\n\t void set (\tF field,\n\t\t\t\t\t\tT value);\n\n\t T get (F field);\n}\n","subject":"Add getter and setter methods."} {"old_contents":"package android.net;\n\nimport io.reon.test.support.LocalWire;\n\nimport java.io.*;\n\npublic class LocalSocket {\n\n\tprivate InputStream inputStream;\n\n\tprivate OutputStream outputStream;\n\n\tpublic LocalSocket() {\n\t\tthis(null, null);\n\t}\n\n\tpublic LocalSocket(InputStream inputStream, OutputStream outputStream) {\n\t\tthis.inputStream = inputStream;\n\t\tthis.outputStream = outputStream;\n\t}\n\n\tpublic OutputStream getOutputStream() throws IOException {\n\t\treturn outputStream;\n\t}\n\n\tpublic InputStream getInputStream() throws IOException {\n\t\treturn inputStream;\n\t}\n\n\tpublic FileDescriptor getFileDescriptor() {\n return new FileDescriptor();\n }\n\n\tpublic void shutdownOutput() throws IOException {\n\n\t}\n\n\tpublic void close() throws IOException {\n\n\t}\n\n\tpublic int getSendBufferSize() throws IOException {\n\t\treturn 1111;\n\t}\n\n\tpublic void connect(LocalSocketAddress localSocketAddress) throws IOException {\n\t\tLocalWire.ClientsSideStreams clientsSideStreams = LocalWire.getInstance().connect();\n\t\tinputStream = clientsSideStreams.getInputStream();\n\t\toutputStream = clientsSideStreams.getOutputStream();\n\t}\n}\n","new_contents":"package android.net;\n\nimport io.reon.test.support.LocalWire;\n\nimport java.io.*;\n\npublic class LocalSocket {\n\n\tprivate InputStream inputStream;\n\n\tprivate OutputStream outputStream;\n\n\tpublic LocalSocket() {\n\t\tthis(null, null);\n\t}\n\n\tpublic LocalSocket(InputStream inputStream, OutputStream outputStream) {\n\t\tthis.inputStream = inputStream;\n\t\tthis.outputStream = outputStream;\n\t}\n\n\tpublic OutputStream getOutputStream() throws IOException {\n\t\treturn outputStream;\n\t}\n\n\tpublic InputStream getInputStream() throws IOException {\n\t\treturn inputStream;\n\t}\n\n\tpublic FileDescriptor getFileDescriptor() {\n return new FileDescriptor();\n }\n\n\tpublic void shutdownOutput() throws IOException {\n\n\t}\n\n\tpublic void close() throws IOException {\n\t\tinputStream.close();\n\t\toutputStream.close();\n\t}\n\n\tpublic int getSendBufferSize() throws IOException {\n\t\treturn 1111;\n\t}\n\n\tpublic void connect(LocalSocketAddress localSocketAddress) throws IOException {\n\t\tLocalWire.ClientsSideStreams clientsSideStreams = LocalWire.getInstance().connect();\n\t\tinputStream = clientsSideStreams.getInputStream();\n\t\toutputStream = clientsSideStreams.getOutputStream();\n\t}\n}\n","subject":"Fix for tests breaking on keep-alive"} {"old_contents":"package org.traccar.helper;\n\nimport org.jboss.netty.buffer.ChannelBuffers;\n\nimport static org.junit.Assert.*;\nimport org.junit.Test;\n\npublic class ChannelBufferToolsTest {\n \n @Test\n public void testReadHexInteger() {\n byte[] buf = {0x01, (byte) 0x90, 0x34};\n int result = ChannelBufferTools.readHexInteger(\n ChannelBuffers.wrappedBuffer(buf), 5);\n assertEquals(1903, result);\n }\n\n}\n","new_contents":"package org.traccar.helper;\n\nimport org.jboss.netty.buffer.ChannelBuffers;\nimport org.junit.Assert;\nimport org.junit.Test;\n\npublic class ChannelBufferToolsTest {\n \n @Test\n public void testReadHexInteger() {\n byte[] buf = {0x01, (byte) 0x90, 0x34};\n int result = ChannelBufferTools.readHexInteger(\n ChannelBuffers.wrappedBuffer(buf), 5);\n Assert.assertEquals(1903, result);\n }\n\n @Test\n public void testReadCoordinate() {\n byte[] buf = {0x03, (byte) 0x85, 0x22, 0x59, 0x34};\n double result = ChannelBufferTools.readCoordinate(\n ChannelBuffers.wrappedBuffer(buf));\n Assert.assertEquals(38.870989, result, 0.00001);\n }\n\n}\n","subject":"Add channel buffer tools test"} {"old_contents":"package org.jbpm.migration;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nimport org.apache.log4j.Logger;\r\n\r\n\/** Convenience class for making the error handling within the parsing and validation processes a little more verbose. *\/\r\nabstract class ErrorCollector {\r\n private final List warningList = new ArrayList();\r\n private final List errorList = new ArrayList();\r\n private final List fatalList = new ArrayList();\r\n\r\n public void warning(final T ex) {\r\n warningList.add(ex);\r\n }\r\n\r\n public void error(final T ex) {\r\n errorList.add(ex);\r\n }\r\n\r\n public void fatalError(final T ex) {\r\n fatalList.add(ex);\r\n }\r\n\r\n public boolean didErrorOccur() {\r\n return !warningList.isEmpty() && !errorList.isEmpty() && !fatalList.isEmpty();\r\n }\r\n\r\n public List getWarningList() {\r\n return warningList;\r\n }\r\n\r\n public List getErrorList() {\r\n return errorList;\r\n }\r\n\r\n public List getFatalList() {\r\n return fatalList;\r\n }\r\n\r\n public void logErrors(final Logger logger) {\r\n for (final T ex : warningList) {\r\n logger.warn(\"==>\", ex);\r\n }\r\n for (final T ex : errorList) {\r\n logger.error(\"==>\", ex);\r\n }\r\n for (final T ex : fatalList) {\r\n logger.fatal(\"==>\", ex);\r\n }\r\n }\r\n}\r\n","new_contents":"package org.jbpm.migration;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nimport org.apache.log4j.Logger;\r\n\r\n\/** Convenience class for making the error handling within the parsing and validation processes a little more verbose. *\/\r\nabstract class ErrorCollector {\r\n private final List warningList = new ArrayList();\r\n private final List errorList = new ArrayList();\r\n private final List fatalList = new ArrayList();\r\n\r\n public void warning(final T ex) {\r\n warningList.add(ex);\r\n }\r\n\r\n public void error(final T ex) {\r\n errorList.add(ex);\r\n }\r\n\r\n public void fatalError(final T ex) {\r\n fatalList.add(ex);\r\n }\r\n\r\n public boolean didErrorOccur() {\r\n \/\/ checking warnings might be too restrictive\r\n return !warningList.isEmpty() || !errorList.isEmpty() ||!fatalList.isEmpty();\r\n }\r\n\r\n public List getWarningList() {\r\n return warningList;\r\n }\r\n\r\n public List getErrorList() {\r\n return errorList;\r\n }\r\n\r\n public List getFatalList() {\r\n return fatalList;\r\n }\r\n\r\n public void logErrors(final Logger logger) {\r\n for (final T ex : warningList) {\r\n logger.warn(\"==>\", ex);\r\n }\r\n for (final T ex : errorList) {\r\n logger.error(\"==>\", ex);\r\n }\r\n for (final T ex : fatalList) {\r\n logger.fatal(\"==>\", ex);\r\n }\r\n }\r\n}\r\n","subject":"Fix for ignoring BPMN validation - JBPM-4000"} {"old_contents":"package org.realityforge.arez;\n\nimport java.util.ArrayList;\nimport javax.annotation.Nonnull;\nimport static org.testng.Assert.*;\n\nclass TestReaction\n implements Reaction\n{\n private final ArrayList _observers = new ArrayList<>();\n\n @Override\n public void react( @Nonnull final Observer observer )\n throws Exception\n {\n observer.getDependencies().forEach( Observable::reportObserved );\n _observers.add( observer );\n }\n\n void assertObserver( final int index, @Nonnull final Observer observer )\n {\n assertTrue( _observers.size() > index );\n assertEquals( _observers.get( index ), observer );\n }\n\n int getCallCount()\n {\n return _observers.size();\n }\n}\n","new_contents":"package org.realityforge.arez;\n\nimport java.util.ArrayList;\nimport javax.annotation.Nonnull;\nimport static org.testng.Assert.*;\n\nclass TestReaction\n implements Reaction\n{\n private final ArrayList _observers = new ArrayList<>();\n\n @Override\n public void react( @Nonnull final Observer observer )\n throws Exception\n {\n observer.getDependencies().stream().filter( o -> !o.isDisposed() ).forEach( Observable::reportObserved );\n _observers.add( observer );\n }\n\n void assertObserver( final int index, @Nonnull final Observer observer )\n {\n assertTrue( _observers.size() > index );\n assertEquals( _observers.get( index ), observer );\n }\n\n int getCallCount()\n {\n return _observers.size();\n }\n}\n","subject":"Update test reaction so it does not invoke reportObserved if observable is disposed"} {"old_contents":"\/\/ You are given a phone book that consists of people's names and their phone number. After that \n\/\/ you will be given some person's name as query. For each query, print the phone number of that \n\/\/ person.\n\nimport java.util.*;\nimport java.io.*;\n\npublic class Solution {\t\n\n\tpublic static void main(String []argh) {\n\t\tMap phonebook = new HashMap();\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tin.nextLine();\n\n\t\tfor(int i=0;i phonebook = new HashMap();\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tin.nextLine();\n\n\t\tfor(int i=0;i delete() {\n return null;\n }\n\n}\n","new_contents":"package models.nodes;\n\nimport play.libs.F.Promise;\n\nimport constants.NodeType;\n\n\npublic abstract class OntologyNode extends LabeledNodeWithProperties {\n public String name;\n\n protected OntologyNode(NodeType label) {\n super(label);\n }\n\n}\n","subject":"Enable operations that write to the DB to be rolled back on error by wrapping them in transactions."} {"old_contents":"import edu.berkeley.nlp.Test;\n\npublic class Main {\n\n public static void main(String[] args) {\n System.out.println(\"Hello World!\");\n Test test = new Test();\n test.main(new String[]{\n \"-test\",\n \"-maxTrainLength\", \"40\",\n \"-maxTestLength\", \"20\",\n \"-usestip\",\n \"-quiet\",\n \"-verticalmarkov\",\n \"-horizontalmarkov\"\n });\n }\n}\n","new_contents":"import edu.berkeley.nlp.Test;\n\npublic class Main {\n\n public static void main(String[] args) {\n System.out.println(\"Hello World!\");\n Test test = new Test();\n test.main(new String[]{\n \"-test\",\n \"-maxTrainLength\", \"99\",\n \"-maxTestLength\", \"40\",\n \"-usestip\",\n \"-quiet\",\n \"-horizontalmarkov\",\n \"-verticalmarkov\"\n });\n }\n}","subject":"Use correct settings for running"} {"old_contents":"package hdm.pk070.jscheme;\n\nimport hdm.pk070.jscheme.obj.SchemeObject;\nimport hdm.pk070.jscheme.reader.SchemeReader;\n\n\/**\n * Created by patrick on 19.04.16.\n *\/\npublic class JScheme {\n\n public static void main(String[] args) {\n System.out.println(\"Welcome to Scheme\\n\");\n for (; ; ) {\n System.out.print(\"> \");\n SchemeObject read = SchemeReader.withStdin().read();\n\/\/ System.out.println();\n }\n }\n}\n","new_contents":"package hdm.pk070.jscheme;\n\nimport hdm.pk070.jscheme.obj.SchemeObject;\nimport hdm.pk070.jscheme.reader.SchemeReader;\n\n\/**\n * Created by patrick on 19.04.16.\n *\/\npublic class JScheme {\n\n public static void main(String[] args) {\n System.out.println(\"Welcome to Scheme\\n\");\n for (; ; ) {\n System.out.print(\"> \");\n SchemeObject result = SchemeReader.withStdin().read();\n System.out.println(result);\n }\n }\n}\n","subject":"Print out what's coming back from 'read'"} {"old_contents":"package com.nelsonjrodrigues.pchud;\n\nimport java.io.IOException;\n\nimport com.nelsonjrodrigues.pchud.net.MessageListener;\nimport com.nelsonjrodrigues.pchud.net.NetThread;\nimport com.nelsonjrodrigues.pchud.net.PcMessage;\n\nimport lombok.extern.slf4j.Slf4j;\n\n@Slf4j\npublic class PcHud {\n\n public static void main(String[] args) {\n\n try {\n NetThread netThread = new NetThread();\n netThread.addMessageListener(new LogMessageListener());\n netThread.start();\n\n netThread.join();\n } catch (IOException | InterruptedException e) {\n log.error(e.getMessage(), e);\n }\n log.debug(\"Exiting\");\n\n }\n\n @Slf4j\n private static class LogMessageListener implements MessageListener {\n\n @Override\n public void onMessage(PcMessage message) {\n log.debug(\"OnMessage {}\", message);\n }\n\n @Override\n public void onTimeout() {\n log.debug(\"OnTimeout\");\n }\n\n }\n\n}\n","new_contents":"package com.nelsonjrodrigues.pchud;\n\nimport java.io.IOException;\n\nimport com.nelsonjrodrigues.pchud.net.MessageListener;\nimport com.nelsonjrodrigues.pchud.net.NetThread;\nimport com.nelsonjrodrigues.pchud.net.PcMessage;\nimport com.nelsonjrodrigues.pchud.world.Worlds;\n\nimport lombok.extern.slf4j.Slf4j;\n\n\n\n@Slf4j\npublic class PcHud {\n\n public static void main(String[] args) {\n\n\n Worlds worlds = new Worlds();\n worlds.addPropertyChangeListener(evt -> {\n log.debug(\"{}\", worlds);\n });\n\n try {\n NetThread netThread = new NetThread();\n netThread.addMessageListener(new LogMessageListener());\n netThread.addMessageListener(worlds);\n netThread.start();\n\n netThread.join();\n }\n catch (IOException | InterruptedException e) {\n log.error(e.getMessage(), e);\n }\n log.debug(\"Exiting\");\n\n }\n\n @Slf4j\n private static class LogMessageListener implements MessageListener {\n\n @Override\n public void onMessage(PcMessage message) {\n log.debug(\"OnMessage {}\", message);\n }\n\n @Override\n public void onTimeout() {\n log.debug(\"OnTimeout\");\n }\n\n }\n\n}\n","subject":"Add Worlds model to main class"} {"old_contents":"\/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage retrofit.client;\n\nimport com.squareup.okhttp.OkHttpClient;\nimport java.io.IOException;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\nimport java.util.concurrent.TimeUnit;\n\n\/** Retrofit client that uses OkHttp for communication. *\/\npublic class OkClient extends UrlConnectionClient {\n private final OkHttpClient client;\n\n public OkClient() {\n this(generateDefaultOkHttp());\n }\n\n public OkClient(OkHttpClient client) {\n this.client = client;\n }\n\n @Override protected HttpURLConnection openConnection(Request request) throws IOException {\n return client.open(new URL(request.getUrl()));\n }\n\n private static OkHttpClient generateDefaultOkHttp() {\n OkHttpClient okHttp = new OkHttpClient();\n okHttp.setConnectTimeout(Defaults.CONNECT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);\n okHttp.setReadTimeout(Defaults.READ_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);\n return okHttp;\n }\n}\n","new_contents":"\/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage retrofit.client;\n\nimport com.squareup.okhttp.OkHttpClient;\nimport java.io.IOException;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\nimport java.util.concurrent.TimeUnit;\n\n\/** Retrofit client that uses OkHttp for communication. *\/\npublic class OkClient extends UrlConnectionClient {\n private static OkHttpClient generateDefaultOkHttp() {\n OkHttpClient client = new OkHttpClient();\n client.setConnectTimeout(Defaults.CONNECT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);\n client.setReadTimeout(Defaults.READ_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);\n return client;\n }\n\n private final OkHttpClient client;\n\n public OkClient() {\n this(generateDefaultOkHttp());\n }\n\n public OkClient(OkHttpClient client) {\n this.client = client;\n }\n\n @Override protected HttpURLConnection openConnection(Request request) throws IOException {\n return client.open(new URL(request.getUrl()));\n }\n}\n","subject":"Move static method to top of file."} {"old_contents":"package mozilla.org.webmaker.activity;\n\nimport android.app.ActionBar;\nimport android.content.res.Resources;\nimport android.graphics.drawable.ColorDrawable;\nimport android.os.Bundle;\nimport android.view.Window;\nimport android.view.WindowManager;\n\nimport mozilla.org.webmaker.R;\nimport mozilla.org.webmaker.WebmakerActivity;\n\npublic class Tinker extends WebmakerActivity {\n public Tinker() {\n super(\"tinker\", R.id.tinker_layout, R.layout.tinker_layout, R.menu.menu_tinker);\n }\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n \/\/ Custom styles\n Resources res = getResources();\n ColorDrawable plum = new ColorDrawable(getResources().getColor(R.color.plum));\n int shadowPlum = res.getColor(R.color.shadow_plum);\n\n ActionBar actionBar = getActionBar();\n actionBar.setBackgroundDrawable(plum);\n\n Window window = getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n window.setStatusBarColor(shadowPlum);\n }\n}\n","new_contents":"package mozilla.org.webmaker.activity;\n\nimport android.app.ActionBar;\nimport android.content.res.Resources;\nimport android.graphics.drawable.ColorDrawable;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.view.Window;\nimport android.view.WindowManager;\n\nimport mozilla.org.webmaker.R;\nimport mozilla.org.webmaker.WebmakerActivity;\n\npublic class Tinker extends WebmakerActivity {\n public Tinker() {\n super(\"tinker\", R.id.tinker_layout, R.layout.tinker_layout, R.menu.menu_tinker);\n }\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n \/\/ Custom styles\n Resources res = getResources();\n ColorDrawable plum = new ColorDrawable(getResources().getColor(R.color.plum));\n int shadowPlum = res.getColor(R.color.shadow_plum);\n\n ActionBar actionBar = getActionBar();\n if (actionBar != null) actionBar.setBackgroundDrawable(plum);\n\n Window window = getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n window.setStatusBarColor(shadowPlum);\n }\n }\n}\n","subject":"Fix possible compatibility issue on older SDK versions"} {"old_contents":"\/*\n * Copyright 2014 Open Networking Laboratory\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.onosproject.store;\n\nimport static com.google.common.base.Preconditions.checkNotNull;\n\n\/**\n * Opaque version structure.\n *

      \n * Classes implementing this interface must also implement\n * {@link #hashCode()} and {@link #equals(Object)}.\n *\/\npublic interface Timestamp extends Comparable {\n\n @Override\n public abstract int hashCode();\n\n @Override\n public abstract boolean equals(Object obj);\n\n \/**\n * Tests if this timestamp is newer than the specified timestamp.\n *\n * @param other timestamp to compare against\n * @return true if this instance is newer\n *\/\n public default boolean isNewerThan(Timestamp other) {\n return this.compareTo(checkNotNull(other)) > 0;\n }\n}\n","new_contents":"\/*\n * Copyright 2014 Open Networking Laboratory\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.onosproject.store;\n\nimport static com.google.common.base.Preconditions.checkNotNull;\n\n\/**\n * Opaque version structure.\n *

      \n * Classes implementing this interface must also implement\n * {@link #hashCode()} and {@link #equals(Object)}.\n *\/\npublic interface Timestamp extends Comparable {\n\n @Override\n int hashCode();\n\n @Override\n boolean equals(Object obj);\n\n \/**\n * Tests if this timestamp is newer than the specified timestamp.\n *\n * @param other timestamp to compare against\n * @return true if this instance is newer\n *\/\n default boolean isNewerThan(Timestamp other) {\n return this.compareTo(checkNotNull(other)) > 0;\n }\n}\n","subject":"Remove unnecessary modifiers to follow the convention"} {"old_contents":"package invtweaks.api;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n@Retention(RetentionPolicy.RUNTIME)\n@Target(ElementType.TYPE)\npublic @interface ContainerGUI {\n \/\/ Size of a chest row\n int rowSize() default 9;\n\n \/\/ Annotation for method to get special inventory slots\n \/\/ Signature int func()\n @Retention(RetentionPolicy.RUNTIME)\n @Target(ElementType.METHOD)\n public @interface RowSizeCallback {}\n\n \/\/ Annotation for method to get special inventory slots\n \/\/ Signature Map> func()\n @Retention(RetentionPolicy.RUNTIME)\n @Target(ElementType.METHOD)\n public @interface ContainerSectionCallback {}\n}\n","new_contents":"package invtweaks.api;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n@Retention(RetentionPolicy.RUNTIME)\n@Target(ElementType.TYPE)\npublic @interface ContainerGUI {\n \/\/ Size of a chest row\n int rowSize() default 9;\n\n \/\/ Annotation for method to get size of a chest row if it can change\n \/\/ Signature int func()\n @Retention(RetentionPolicy.RUNTIME)\n @Target(ElementType.METHOD)\n public @interface RowSizeCallback {}\n\n \/\/ Annotation for method to get special inventory slots\n \/\/ Signature Map> func()\n @Retention(RetentionPolicy.RUNTIME)\n @Target(ElementType.METHOD)\n public @interface ContainerSectionCallback {}\n}\n","subject":"Fix comment in API files."} {"old_contents":"package org.pfaa.block;\n\nimport java.util.List;\n\nimport net.minecraft.block.Block;\nimport net.minecraft.block.material.Material;\nimport net.minecraft.creativetab.CreativeTabs;\nimport net.minecraft.item.ItemStack;\n\npublic abstract class CompositeBlock extends Block implements CompositeBlockAccessors {\n\n\tpublic CompositeBlock(int id, int textureIndex, Material material) {\n\t\tsuper(id, textureIndex, material);\n\t}\n\tpublic CompositeBlock(int id, Material material) {\n\t\tthis(id, 0, material);\n\t}\n\t\n\t@Override\n\tpublic int damageDropped(int meta) {\n\t\treturn meta;\n\t}\n\n\t@Override\n\tpublic int getBlockTextureFromSideAndMetadata(int side, int meta) \n\t{\n\t\treturn blockIndexInTexture + damageDropped(meta);\n\t}\n\n\t\/* (non-Javadoc)\n\t * @see org.pfaa.block.ICompositeBlock#getSubBlocks(int, net.minecraft.creativetab.CreativeTabs, java.util.List)\n\t *\/\n\t@Override\n\tpublic void getSubBlocks(int id, CreativeTabs creativeTabs, List list)\n {\n\t\tfor (int i = 0; i < getMetaCount(); ++i)\n {\n list.add(new ItemStack(id, 1, damageDropped(i)));\n }\n }\n\t\n\tpublic abstract int getMetaCount();\n\t\n\tpublic float getBlockResistance() {\n\t\treturn this.blockResistance;\n\t}\n}\n","new_contents":"package org.pfaa.block;\n\nimport java.util.List;\n\nimport net.minecraft.block.Block;\nimport net.minecraft.block.material.Material;\nimport net.minecraft.creativetab.CreativeTabs;\nimport net.minecraft.item.ItemStack;\n\npublic abstract class CompositeBlock extends Block implements CompositeBlockAccessors {\n\n\tpublic CompositeBlock(int id, int textureIndex, Material material) {\n\t\tsuper(id, textureIndex, material);\n\t}\n\tpublic CompositeBlock(int id, Material material) {\n\t\tthis(id, 0, material);\n\t}\n\t\n\t@Override\n\tpublic int damageDropped(int meta) {\n\t\treturn meta;\n\t}\n\n\t@Override\n\tpublic int getBlockTextureFromSideAndMetadata(int side, int meta) \n\t{\n\t\treturn blockIndexInTexture + damageDropped(meta);\n\t}\n\n\t\/* (non-Javadoc)\n\t * @see org.pfaa.block.ICompositeBlock#getSubBlocks(int, net.minecraft.creativetab.CreativeTabs, java.util.List)\n\t *\/\n\t@Override\n\tpublic void getSubBlocks(int id, CreativeTabs creativeTabs, List list)\n {\n\t\tfor (int i = 0; i < getMetaCount(); ++i)\n {\n list.add(new ItemStack(id, 1, damageDropped(i)));\n }\n }\n\t\n\tpublic abstract int getMetaCount();\n\t\n\tpublic float getBlockResistance() {\n\t\treturn this.blockResistance \/ 3.0F;\n\t}\n}\n","subject":"Correct for internal adjustment to block resistance in getter."} {"old_contents":"package com.google.refine.importers.tree;\n\nimport java.util.LinkedList;\nimport java.util.List;\n\nimport com.google.refine.model.Cell;\n\n\/**\n * A record describes a data element in a tree-structure\n *\n *\/\npublic class ImportRecord {\n public List> rows = new LinkedList>();\n}","new_contents":"package com.google.refine.importers.tree;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport com.google.refine.model.Cell;\n\n\/**\n * A record describes a data element in a tree-structure\n *\n *\/\npublic class ImportRecord {\n public List> rows = new ArrayList>();\n}","subject":"Switch from LinkedList to ArrayList"} {"old_contents":"package com.breakersoft.plow;\n\npublic class Signal {\n\n \/**\n * Exit signal for an aborted dispatch.\n *\/\n public static final int NORMAL = 0;\n\n \/**\n * Exit signal for an aborted dispatch.\n *\/\n public static final int ABORTED_TASK = 667;\n\n \/**\n * Exit signal for an orphaned task.\n *\/\n public static final int ORPANED_TASK = 668;\n\n \/**\n * Task was manually killed\n *\/\n public static final int MANUAL_KILL = 669;\n\n \/**\n * Task was manually retried\n *\/\n public static final int MANUAL_RETRY = 670;\n\n \/**\n * The node went down.\n *\/\n public static final int NODE_DOWN = 671;\n\n}\n","new_contents":"package com.breakersoft.plow;\n\npublic class Signal {\n\n \/**\n * Exit signal for an aborted dispatch.\n *\/\n public static final int NORMAL = 0;\n\n \/**\n * Exit signal when a node is shutdown.\n *\/\n public static final int NODE_SHUTDOWN = 86;\n\n \/**\n * Exit signal for an aborted dispatch.\n *\/\n public static final int ABORTED_TASK = 667;\n\n \/**\n * Exit signal for an orphaned task.\n *\/\n public static final int ORPANED_TASK = 668;\n\n \/**\n * Task was manually killed\n *\/\n public static final int MANUAL_KILL = 669;\n\n \/**\n * Task was manually retried\n *\/\n public static final int MANUAL_RETRY = 670;\n\n \/**\n * The node went down.\n *\/\n public static final int NODE_DOWN = 671;\n\n}\n","subject":"Add signal for shutdown procs"} {"old_contents":"package io.prometheus.cloudwatch;\n\nimport io.prometheus.client.exporter.MetricsServlet;\nimport java.io.FileReader;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.servlet.ServletContextHandler;\nimport org.eclipse.jetty.servlet.ServletHolder;\n\npublic class WebServer {\n public static void main(String[] args) throws Exception {\n if (args.length < 2) {\n System.err.println(\"Usage: WebServer \");\n System.exit(1);\n }\n CloudWatchCollector cc = new CloudWatchCollector(new FileReader(args[1])).register();\n\n int port = Integer.parseInt(args[0]);\n Server server = new Server(port);\n ServletContextHandler context = new ServletContextHandler();\n context.setContextPath(\"\/\");\n server.setHandler(context);\n context.addServlet(new ServletHolder(new MetricsServlet()), \"\/metrics\");\n context.addServlet(new ServletHolder(new HomePageServlet()), \"\/\");\n server.start();\n server.join();\n }\n}\n","new_contents":"package io.prometheus.cloudwatch;\n\nimport io.prometheus.client.exporter.MetricsServlet;\nimport java.io.FileReader;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.servlet.ServletContextHandler;\nimport org.eclipse.jetty.servlet.ServletHolder;\n\npublic class WebServer {\n public static void main(String[] args) throws Exception {\n if (args.length < 2) {\n System.err.println(\"Usage: WebServer \");\n System.exit(1);\n }\n CloudWatchCollector cc = new CloudWatchCollector(new FileReader(args[1])).register();\n\n int port = Integer.parseInt(args[0]);\n Server server = new Server(port);\n ServletContextHandler context = new ServletContextHandler();\n context.setContextPath(\"\/\");\n server.setHandler(context);\n context.addServlet(new ServletHolder(new MetricsServlet()), \"\/metrics\");\n context.addServlet(new ServletHolder(new HomePageServlet()), \"\/\");\n server.start();\n server.join();\n }\n}\n","subject":"Update error message to yml"} {"old_contents":"package info.agrueneberg.fhir.filters;\n\nimport java.io.IOException;\nimport javax.servlet.Filter;\nimport javax.servlet.FilterChain;\nimport javax.servlet.FilterConfig;\nimport javax.servlet.ServletException;\nimport javax.servlet.ServletRequest;\nimport javax.servlet.ServletResponse;\nimport javax.servlet.http.HttpServletResponse;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class CorsFilter implements Filter {\n\n @Override\n public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {\n HttpServletResponse response = (HttpServletResponse) res;\n response.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n response.setHeader(\"Access-Control-Allow-Methods\", \"GET, POST, OPTIONS, PUT, DELETE\");\n response.setHeader(\"Access-Control-Max-Age\", \"3600\");\n response.setHeader(\"Access-Control-Allow-Headers\", \"x-requested-with\");\n chain.doFilter(req, res);\n }\n\n @Override\n public void init(FilterConfig filterConfig) {\n }\n\n @Override\n public void destroy() {\n }\n\n}","new_contents":"package info.agrueneberg.fhir.filters;\n\nimport java.io.IOException;\nimport javax.servlet.Filter;\nimport javax.servlet.FilterChain;\nimport javax.servlet.FilterConfig;\nimport javax.servlet.ServletException;\nimport javax.servlet.ServletRequest;\nimport javax.servlet.ServletResponse;\nimport javax.servlet.http.HttpServletResponse;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class CorsFilter implements Filter {\n\n @Override\n public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {\n HttpServletResponse response = (HttpServletResponse) res;\n response.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n response.setHeader(\"Access-Control-Allow-Methods\", \"GET, POST, OPTIONS, PUT, DELETE\");\n response.setHeader(\"Access-Control-Allow-Headers\", \"x-requested-with, content-type\");\n response.setHeader(\"Access-Control-Max-Age\", \"3600\");\n chain.doFilter(req, res);\n }\n\n @Override\n public void init(FilterConfig filterConfig) {\n }\n\n @Override\n public void destroy() {\n }\n\n}","subject":"Allow Content-Type header in CORS."} {"old_contents":"package toothpick;\n\nimport toothpick.registries.memberinjector.MemberInjectorRegistryLocator;\n\n\/**\n * Default implementation of an injector.\n *\/\npublic final class InjectorImpl implements Injector {\n \/**\n * {@inheritDoc}\n *\n *

      \n * ⚠ Warning<\/b> ⚠ : This implementation needs a proper setup of {@link toothpick.registries.MemberInjectorRegistry} instances\n * at the annotation processor level. We will bubble up the hierarchy, starting at class {@code T}. As soon\n * as a {@link MemberInjector} is found, we use it to inject the members of {@code obj}. If registries are not find then\n * you will observe strange behaviors at runtime : only members defined in super class will be injected.<\/em>\n * <\/p>\n *\/\n @Override\n public void inject(T obj, Scope scope) {\n Class currentClass = (Class) obj.getClass();\n do {\n MemberInjector memberInjector = MemberInjectorRegistryLocator.getMemberInjector(currentClass);\n if (memberInjector != null) {\n memberInjector.inject(obj, scope);\n return;\n } else {\n currentClass = currentClass.getSuperclass();\n }\n } while (currentClass != null);\n }\n}\n","new_contents":"package toothpick;\n\nimport toothpick.registries.memberinjector.MemberInjectorRegistryLocator;\n\n\/**\n * Default implementation of an injector.\n *\/\npublic final class InjectorImpl implements Injector {\n \/**\n * {@inheritDoc}\n *\n *

      \n * ⚠ Warning<\/b> ⚠ : This implementation needs a proper setup of {@link toothpick.registries.MemberInjectorRegistry} instances\n * at the annotation processor level. We will bubble up the hierarchy, starting at class {@code T}. As soon\n * as a {@link MemberInjector} is found, we use it to inject the members of {@code obj}. If registries are not find then\n * you will observe strange behaviors at runtime : only members defined in super class will be injected.<\/em>\n * <\/p>\n *\/\n @Override\n public void inject(T obj, Scope scope) {\n Class currentClass = (Class) obj.getClass();\n do {\n MemberInjector memberInjector = MemberInjectorRegistryLocator.getMemberInjector(currentClass);\n if (memberInjector != null) {\n memberInjector.inject(obj, scope);\n return;\n } else {\n currentClass = currentClass.getSuperclass();\n }\n } while (currentClass != null);\n throw new RuntimeException(String.format(\"Object %s of class %s could not be injected. Make sure all registries are setup properly.\", obj,\n obj != null ? obj.getClass() : \"(N\/A)\"));\n }\n}\n","subject":"Make inject throw an exception if no injection took place."} {"old_contents":"package ceylon.language;\n\nimport com.redhat.ceylon.common.Versions;\nimport com.redhat.ceylon.compiler.java.metadata.Ceylon;\nimport com.redhat.ceylon.compiler.java.metadata.Object;\n\n@Ceylon(major = 3) @Object\npublic final class language_ {\n\t\n public java.lang.String getVersion() {\n return Versions.CEYLON_VERSION_NUMBER;\n }\n \n public long getMajorVersion() {\n return Versions.CEYLON_VERSION_MAJOR;\n }\n\n public long getMinorVersion() {\n return Versions.CEYLON_VERSION_MINOR;\n }\n\n public long getReleaseVersion() {\n return Versions.CEYLON_VERSION_RELEASE;\n }\n\n public java.lang.String getVersionName() {\n return Versions.CEYLON_VERSION_NAME;\n }\n \n public long getMajorVersionBinary() {\n return Versions.JVM_BINARY_MAJOR_VERSION;\n }\n\n public long getMinorVersionBinary() {\n return Versions.JVM_BINARY_MINOR_VERSION;\n }\n\n @Override\n public java.lang.String toString() {\n \treturn \"language\";\n }\n \n private language_() {}\n private static final language_ value = new language_();\n \n public static language_ getLanguage() {\n return value;\n }\n}\n","new_contents":"package ceylon.language;\n\nimport com.redhat.ceylon.common.Versions;\nimport com.redhat.ceylon.compiler.java.metadata.Ceylon;\nimport com.redhat.ceylon.compiler.java.metadata.Object;\n\n@Ceylon(major = 3) @Object\npublic final class language_ {\n\t\n public java.lang.String getVersion() {\n return Versions.CEYLON_VERSION_NUMBER;\n }\n \n public long getMajorVersion() {\n return Versions.CEYLON_VERSION_MAJOR;\n }\n\n public long getMinorVersion() {\n return Versions.CEYLON_VERSION_MINOR;\n }\n\n public long getReleaseVersion() {\n return Versions.CEYLON_VERSION_RELEASE;\n }\n\n public java.lang.String getVersionName() {\n return Versions.CEYLON_VERSION_NAME;\n }\n \n public long getMajorVersionBinary() {\n return Versions.JVM_BINARY_MAJOR_VERSION;\n }\n\n public long getMinorVersionBinary() {\n return Versions.JVM_BINARY_MINOR_VERSION;\n }\n\n @Override\n public java.lang.String toString() {\n \treturn \"language\";\n }\n \n private language_() {}\n private static final language_ value = new language_();\n \n public static language_ getLanguage$() {\n return value;\n }\n}\n","subject":"Fix the language object (wasn't available before)"} {"old_contents":"package seedu.geekeep.ui;\n\nimport javafx.fxml.FXML;\nimport javafx.scene.control.Label;\nimport javafx.scene.layout.FlowPane;\nimport javafx.scene.layout.HBox;\nimport javafx.scene.layout.Region;\nimport seedu.geekeep.model.task.ReadOnlyTask;\n\npublic class TaskCard extends UiPart {\n\n private static final String FXML = \"PersonListCard.fxml\";\n\n @FXML\n private HBox cardPane;\n @FXML\n private Label name;\n @FXML\n private Label id;\n @FXML\n private Label phone;\n @FXML\n private Label address;\n @FXML\n private Label email;\n @FXML\n private FlowPane tags;\n\n public TaskCard(ReadOnlyTask person, int displayedIndex) {\n super(FXML);\n name.setText(person.getTitle().fullTitle);\n id.setText(displayedIndex + \". \");\n phone.setText(person.getEndDateTime().value);\n address.setText(person.getLocation().value);\n email.setText(person.getStartDateTime().value);\n initTags(person);\n }\n\n private void initTags(ReadOnlyTask person) {\n person.getTags().forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));\n }\n}\n","new_contents":"package seedu.geekeep.ui;\n\nimport javafx.fxml.FXML;\nimport javafx.scene.control.Label;\nimport javafx.scene.layout.FlowPane;\nimport javafx.scene.layout.HBox;\nimport javafx.scene.layout.Region;\nimport seedu.geekeep.model.task.ReadOnlyTask;\n\npublic class TaskCard extends UiPart {\n\n private static final String FXML = \"PersonListCard.fxml\";\n\n @FXML\n private HBox cardPane;\n @FXML\n private Label name;\n @FXML\n private Label id;\n @FXML\n private Label phone;\n @FXML\n private Label address;\n @FXML\n private Label email;\n @FXML\n private FlowPane tags;\n\n public TaskCard(ReadOnlyTask person, int displayedIndex) {\n super(FXML);\n name.setText(person.getTitle().fullTitle);\n id.setText(\"#\" + displayedIndex + \" \");\n\n if (person.getEndDateTime() != null && person.getStartDateTime() != null) {\n phone.setText(person.getStartDateTime() + \" until \" + person.getEndDateTime());\n } else if (person.getEndDateTime() != null && person.getStartDateTime() == null) {\n phone.setText(person.getEndDateTime().value);\n } else {\n phone.setText(null);\n }\n\n if (person.getLocation() == null) {\n address.setText(\"\");\n } else {\n address.setText(person.getLocation().value);\n }\n\n initTags(person);\n }\n\n private void initTags(ReadOnlyTask person) {\n person.getTags().forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));\n }\n}\n","subject":"Update display of task card"} {"old_contents":"\/*\n * Copyright (C) 2014 Pedro Vicente Gomez Sanchez.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.github.pedrovgs.sample;\n\nimport android.os.Bundle;\nimport android.support.v7.app.ActionBarActivity;\n\npublic class MainActivity extends ActionBarActivity {\n\n @Override protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n }\n}\n","new_contents":"\/*\n * Copyright (C) 2015 Pedro Vicente Gomez Sanchez.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.github.pedrovgs.sample;\n\nimport android.os.Bundle;\nimport android.support.v7.app.ActionBarActivity;\n\npublic class MainActivity extends ActionBarActivity {\n\n @Override protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n }\n}\n","subject":"Change copyright to use 2015 version"} {"old_contents":"package de.retest.recheck.ui.descriptors;\n\nimport java.io.Serializable;\n\nimport javax.xml.bind.annotation.XmlRootElement;\n\nimport de.retest.recheck.util.StringSimilarity;\n\n@XmlRootElement\npublic class TextAttribute extends StringAttribute {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\t\/\/ Used by JaxB\n\tprotected TextAttribute() {}\n\n\tpublic TextAttribute( final String key, final String value ) {\n\t\tthis( key, value, null );\n\t}\n\n\tpublic TextAttribute( final String key, final String value, final String variableName ) {\n\t\tsuper( key, value != null ? value.trim() : null, variableName );\n\t}\n\n\t@Override\n\tpublic double match( final Attribute other ) {\n\t\tif ( !(other instanceof TextAttribute) ) {\n\t\t\treturn NO_MATCH;\n\t\t}\n\t\tassert other.getKey().equals( getKey() );\n\t\treturn StringSimilarity.textSimilarity( getValue(), ((StringAttribute) other).getValue() );\n\t}\n\n\t@Override\n\tpublic Attribute applyChanges( final Serializable actual ) {\n\t\treturn new TextAttribute( getKey(), (String) actual, getVariableName() );\n\t}\n\n\t@Override\n\tpublic ParameterizedAttribute applyVariableChange( final String variableName ) {\n\t\treturn new TextAttribute( getKey(), getValue(), variableName );\n\t}\n}\n","new_contents":"package de.retest.recheck.ui.descriptors;\n\nimport java.io.Serializable;\n\nimport javax.xml.bind.annotation.XmlRootElement;\n\nimport de.retest.recheck.util.StringSimilarity;\n\n@XmlRootElement\npublic class TextAttribute extends StringAttribute {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\t\/\/ Used by JaxB\n\tprotected TextAttribute() {}\n\n\tpublic TextAttribute( final String key, final String value ) {\n\t\tthis( key, value, null );\n\t}\n\n\tpublic TextAttribute( final String key, final String value, final String variableName ) {\n\t\tsuper( key, value, variableName );\n\t}\n\n\t@Override\n\tpublic double match( final Attribute other ) {\n\t\tif ( !(other instanceof TextAttribute) ) {\n\t\t\treturn NO_MATCH;\n\t\t}\n\t\tassert other.getKey().equals( getKey() );\n\t\treturn StringSimilarity.textSimilarity( getValue(), ((StringAttribute) other).getValue() );\n\t}\n\n\t@Override\n\tpublic Attribute applyChanges( final Serializable actual ) {\n\t\treturn new TextAttribute( getKey(), (String) actual, getVariableName() );\n\t}\n\n\t@Override\n\tpublic ParameterizedAttribute applyVariableChange( final String variableName ) {\n\t\treturn new TextAttribute( getKey(), getValue(), variableName );\n\t}\n}\n","subject":"Fix value should be given formatted"} {"old_contents":"package ru.stqa.pft.sandbox;\n\nimport org.testng.Assert;\nimport org.testng.annotations.Test;\n\npublic class EquationTests {\n\n @Test\n public void test0() {\n Equation e = new Equation(1,1,1);\n\/\/ Assert.assertEquals(e.rootNumber(), 0);\n Assert.assertEquals(e.rootNumber(), 1);\n }\n\n @Test\n public void test1() {\n Equation e = new Equation(1,2,1);\n Assert.assertEquals(e.rootNumber(), 1);\n }\n\n @Test\n public void test3() {\n Equation e = new Equation(1,5,6);\n Assert.assertEquals(e.rootNumber(), 2);\n }\n\n @Test\n public void testLinear() {\n Equation e = new Equation(0,1,1);\n Assert.assertEquals(e.rootNumber(), 1);\n }\n\n @Test\n public void testConstant() {\n Equation e = new Equation(0,0,1);\n Assert.assertEquals(e.rootNumber(), 0);\n }\n\n @Test\n public void testZero() {\n Equation e = new Equation(0,0,0);\n Assert.assertEquals(e.rootNumber(), -1);\n }\n\n}\n","new_contents":"package ru.stqa.pft.sandbox;\n\nimport org.testng.Assert;\nimport org.testng.annotations.Test;\n\npublic class EquationTests {\n\n @Test\n public void test0() {\n Equation e = new Equation(1,1,1);\n Assert.assertEquals(e.rootNumber(), 0);\n }\n\n @Test\n public void test1() {\n Equation e = new Equation(1,2,1);\n Assert.assertEquals(e.rootNumber(), 1);\n }\n\n @Test\n public void test3() {\n Equation e = new Equation(1,5,6);\n Assert.assertEquals(e.rootNumber(), 2);\n }\n\n @Test\n public void testLinear() {\n Equation e = new Equation(0,1,1);\n Assert.assertEquals(e.rootNumber(), 1);\n }\n\n @Test\n public void testConstant() {\n Equation e = new Equation(0,0,1);\n Assert.assertEquals(e.rootNumber(), 0);\n }\n\n @Test\n public void testZero() {\n Equation e = new Equation(0,0,0);\n Assert.assertEquals(e.rootNumber(), -1);\n }\n\n}\n","subject":"Revert \"Испорчен тест для проверки Jenkins\""} {"old_contents":"package am;\r\n\r\nimport am.app.Core;\r\nimport am.batchMode.TrackDispatcher;\r\nimport am.userInterface.UI;\r\n\r\n\/**\r\n * Main class -\r\n *\r\n * This class creates an instance of UI class\r\n *\r\n * @author ADVIS Research Laboratory\r\n * @version 11\/27\/2004\r\n *\/\r\npublic class Main\r\n{\r\n\t\r\n\t\/*******************************************************************************************\/\r\n\t\/**\r\n\t * This is the main function\r\n\t * It creates a new instance of UI class\r\n\t * \r\n\t * @param args array of strings\r\n\t *\/\r\n\tpublic static void main(String args[])\r\n\t{\r\n\t\tif(args.length == 0 ){\r\n\t\t\t\/\/UI ui;\r\n\t\t\tUI ui = new UI();\r\n\t\t\tCore.getInstance().setUI(ui);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tString track = args[0];\r\n\t\t\tString subTrack = \"\";\r\n\t\t\tif(args.length > 1){\r\n\t\t\t\tsubTrack = args[1];\r\n\t\t\t}\r\n\t\t\tTrackDispatcher.dispatchTrack(track, subTrack);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n","new_contents":"\/** ________________________________________\r\n * ___\/ Copyright Notice \/ Warranty Disclaimer \\________________\r\n *\r\n * @copyright { Copyright (c) 2010\r\n * Advances in Information Systems Laboratory at the\r\n * University of Illinois at Chicago\r\n * All Rights Reserved. }\r\n * \r\n * @disclaimer {\r\n * This work is distributed WITHOUT ANY WARRANTY;\r\n * without even the implied warranty of MERCHANTABILITY or\r\n * FITNESS FOR A PARTICULAR PURPOSE. }\r\n * \r\n * _____________________\r\n * ___\/ Authors \/ Changelog \\___________________________________ \r\n * \r\n * \r\n *\/\r\n\r\n\r\npackage am;\r\n\r\nimport javax.swing.SwingUtilities;\r\n\r\nimport am.app.Core;\r\nimport am.batchMode.TrackDispatcher;\r\nimport am.userInterface.UI;\r\n\r\n\/**\r\n * Main class -\r\n *\r\n * This class creates an instance of UI class\r\n *\r\n * @author ADVIS Research Laboratory\r\n * @version 11\/27\/2004\r\n *\/\r\npublic class Main\r\n{\r\n\t\/**\r\n\t * This is the application entry point.\r\n\t * It creates instantiates.\r\n\t * \r\n\t * @param args Command line arguments, used for operating AgreementMaker in automatic mode, without a UI.\r\n\t *\/\r\n\tpublic static void main(String args[])\r\n\t{\r\n\t\tif(args.length == 0 ){\r\n\t\t\t\/\/ Proper way of intializing the UI.\r\n\t\t\t\/\/ Reference: http:\/\/java.sun.com\/developer\/technicalArticles\/javase\/swingworker\/ (Starting off on the Right Thread)\r\n\t\t\tSwingUtilities.invokeLater( \r\n\t\t\t\t\tnew Runnable() {\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\tCore.setUI( new UI() );\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tString track = args[0];\r\n\t\t\tString subTrack = \"\";\r\n\t\t\tif(args.length > 1){\r\n\t\t\t\tsubTrack = args[1];\r\n\t\t\t}\r\n\t\t\tTrackDispatcher.dispatchTrack(track, subTrack);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n","subject":"Initialize the UI in the Event Dispatching Thread."} {"old_contents":"package fi.helsinki.cs.tmc.cli.command;\n\nimport fi.helsinki.cs.tmc.cli.Application;\nimport java.util.HashMap;\nimport java.util.Map;\n\n\/**\n * Class creates a map for commands.\n *\/\npublic class CommandMap {\n\n private Map commands;\n\n \/**\n * Constructor.\n *\/\n public CommandMap(Application app) {\n this.commands = new HashMap<>();\n createCommand(new TestCommand(app));\n createCommand(new HelpCommand(app));\n }\n\n private void createCommand(Command command) {\n this.commands.put(command.getName(), command);\n }\n\n \/**\n * Get command by default name.\n * @param name\n * @return Command\n *\/\n public Command getCommand(String name) {\n return commands.get(name);\n }\n\n public Map getCommands() {\n return this.commands;\n }\n}\n","new_contents":"package fi.helsinki.cs.tmc.cli.command;\n\nimport fi.helsinki.cs.tmc.cli.Application;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n\/**\n * Class creates a map for commands.\n *\/\npublic class CommandMap {\n\n private Map commands;\n\n \/**\n * Constructor.\n *\/\n public CommandMap(Application app) {\n this.commands = new HashMap<>();\n createCommand(new TestCommand(app));\n createCommand(new HelpCommand(app));\n }\n\n private void createCommand(Command command) {\n this.commands.put(command.getName(), command);\n }\n\n \/**\n * Get command by default name.\n * @param name\n * @return Command\n *\/\n public Command getCommand(String name) {\n return commands.get(name);\n }\n\n public Map getCommands() {\n return this.commands;\n }\n}\n","subject":"Fix style error at command map imports."} {"old_contents":"\/**\n * Copyright 2010 The ForPlay Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License. \n *\/\npackage forplay.core;\n\n\/**\n * Generic platform interface. New platforms are defined as implementations of this interface.\n *\/\npublic interface Platform {\n\n Audio audio();\n\n Graphics graphics();\n \n AssetManager assetManager();\n\n Json json();\n\n Keyboard keyboard();\n\n Log log();\n\n Net net();\n\n Pointer pointer();\n\n \/**\n * Return the mouse if it is supported, or null otherwise.\n * \n * @return the mouse if it is supported, or null otherwise.\n *\/\n Mouse mouse();\n\n Storage storage();\n \n Analytics analytics();\n\n float random();\n\n void run(Game game);\n\n double time();\n\n RegularExpression regularExpression();\n\n void openURL(String url);\n}\n","new_contents":"\/**\n * Copyright 2010 The ForPlay Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License. \n *\/\npackage forplay.core;\n\n\/**\n * Generic platform interface. New platforms are defined as implementations of this interface.\n *\/\npublic interface Platform {\n\n Audio audio();\n\n Graphics graphics();\n \n AssetManager assetManager();\n\n Json json();\n\n Keyboard keyboard();\n\n Log log();\n\n Net net();\n\n Pointer pointer();\n\n Mouse mouse();\n\n Storage storage();\n \n Analytics analytics();\n\n float random();\n\n void run(Game game);\n\n double time();\n\n RegularExpression regularExpression();\n\n void openURL(String url);\n}\n","subject":"Remove useless comment about returning a null mouse. Access mouse through ForPlay.mouse()."} {"old_contents":"public class CountingSort {\n\tpublic static int[] countingSort(int[] unsorted) {\n\t\tint maxValue = max(unsorted);\n\n\t\t\/\/ Count occurrences of each value in unsorted\n\t\tint[] counts = new int[maxValue + 1];\n\n\t\tfor(int value : unsorted)\n\t\t\tcounts[value]++;\n\n\t\tfor(int i = 1; i < counts.length; i++)\n\t\t\tcounts[i] += counts[i - 1];\n\n\t\t\/\/ Reorder values in unsorted\n\t\tint[] sorted = new int[unsorted.length];\n\t\tfor(int value : unsorted) {\n\t\t\tcounts[value] -= 1;\n\t\t\tint index = counts[value];\n\t\t\tsorted[index] = value;\n\t\t}\n\n\t\treturn sorted;\n\t}\n\n\tprivate static int max(int[] array) {\n\t\tint max = Integer.MIN_VALUE;\n\n\t\tfor(int value : array) {\n\t\t\tif(value > max) max = value;\n\t\t}\n\n\t\treturn max;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tint[] unsorted = {5, 5, 5, 4, 3, 2, 1, 0};\n\t\tint[] sorted = countingSort(unsorted);\n\t\tfor(int value : sorted)\n\t\t\tSystem.out.println(value);\n\t}\n}","new_contents":"public class CountingSort {\n\tpublic static int[] countingSort(int[] unsorted) {\n\t\tint minValue = min(unsorted);\n\t\tint maxValue = max(unsorted);\n\n\t\t\/\/ Adjust max so that min equals zero\n\t\tint offset = -minValue;\n\t\tint adjustedMax = maxValue + offset;\n\n\t\t\/\/ Count occurrences of each value in unsorted\n\t\tint[] counts = new int[adjustedMax + 1];\n\n\t\tfor(int value : unsorted)\n\t\t\tcounts[value + offset]++;\n\n\t\tfor(int i = 1; i < counts.length; i++)\n\t\t\tcounts[i] += counts[i - 1];\n\n\t\t\/\/ Reorder values in unsorted\n\t\tint[] sorted = new int[unsorted.length];\n\t\tfor(int value : unsorted) {\n\t\t\tint index = --counts[value + offset];\n\t\t\tsorted[index] = value;\n\t\t}\n\n\t\treturn sorted;\n\t}\n\n\tprivate static int min(int[] array) {\n\t\tint min = Integer.MAX_VALUE;\n\n\t\tfor(int value : array)\n\t\t\tif(value < min) min = value;\n\n\t\treturn min;\n\t}\n\n\tprivate static int max(int[] array) {\n\t\tint max = Integer.MIN_VALUE;\n\n\t\tfor(int value : array)\n\t\t\tif(value > max) max = value;\n\n\t\treturn max;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tint[] unsorted = {5, 5, 5, 4, 3, 2, 1, 0, -1, -2, -3, -3, -3};\n\t\tint[] sorted = countingSort(unsorted);\n\t\tfor(int value : sorted)\n\t\t\tSystem.out.println(value);\n\t}\n}","subject":"Allow counting sort to handle negative numbers"} {"old_contents":"package org.skife.jdbi.v2.exceptions;\n\npublic class UnableToCreateSqlObjectException extends DBIException {\n\n public UnableToCreateSqlObjectException(String message) {\n super(message);\n }\n}\n","new_contents":"\/*\n * Copyright (C) 2004 - 2014 Brian McCallister\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.skife.jdbi.v2.exceptions;\n\npublic class UnableToCreateSqlObjectException extends DBIException {\n\n public UnableToCreateSqlObjectException(String message) {\n super(message);\n }\n}\n","subject":"Add license header to please Findbugs"} {"old_contents":"package net.doepner.brikpiks;\n\n\/**\n * Application entry point\n *\/\npublic final class Main {\n\n public static void main(String[] args) {\n System.out.println(\"Brik Piks\");\n\n \/\/ TODO : Get started by reviewing\n \/\/ http:\/\/stackoverflow.com\/questions\/15777821\/how-can-i-pixelate-a-jpg-with-java\n }\n\n}\n","new_contents":"package net.doepner.brikpiks;\n\n\/**\n * Application entry point\n *\/\npublic final class Main {\n\n public static void main(String[] args) {\n System.out.println(\"Brik Piks\");\n\n \/\/ TODO : Get started by reviewing\n \/\/ http:\/\/stackoverflow.com\/questions\/15777821\/how-can-i-pixelate-a-jpg-with-java\n \/\/ http:\/\/stackoverflow.com\/questions\/25761438\/understanding-bufferedimage-getrgb-output-values\n \/\/ http:\/\/stackoverflow.com\/questions\/28162488\/get-average-color-on-bufferedimage-and-bufferedimage-portion-as-fast-as-possible\n }\n\n}\n","subject":"Add a pointer to some code examples"} {"old_contents":"package lejos.hardware.sensor;\nimport lejos.hardware.port.UARTPort;\nimport lejos.robotics.RangeFinder;\n\n\/**\n * Basic sensor driver for the Lego EV3 Ultrasonic sensor.
      \n * TODO: Need to implement other modes. Consider implementing other methods\n * to allow this device to be used in place of the NXT device (getDistance) etc.\n * @author andy\n *\n *\/\npublic class EV3UltrasonicSensor extends UARTSensor implements RangeFinder\n{\n\n \/**\n * Create the sensor class. The sensor will be set to return measurements in CM.\n * @param port\n *\/\n public EV3UltrasonicSensor(UARTPort port)\n {\n super(port);\n }\n\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public float getRange()\n {\n return (float)port.getShort()\/10.0f;\n }\n\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public float[] getRanges()\n {\n \/\/ TODO Work out how to use other modes, maybe change this\n float [] result = new float[1];\n result[0] = getRange();\n return result;\n }\n\n}\n","new_contents":"package lejos.hardware.sensor;\nimport lejos.hardware.port.Port;\nimport lejos.hardware.port.UARTPort;\nimport lejos.robotics.RangeFinder;\n\n\/**\n * Basic sensor driver for the Lego EV3 Ultrasonic sensor.
      \n * TODO: Need to implement other modes. Consider implementing other methods\n * to allow this device to be used in place of the NXT device (getDistance) etc.\n * @author andy\n *\n *\/\npublic class EV3UltrasonicSensor extends UARTSensor implements RangeFinder\n{\n\n \/**\n * Create the sensor class. The sensor will be set to return measurements in CM.\n * @param port\n *\/\n public EV3UltrasonicSensor(UARTPort port)\n {\n super(port);\n }\n\n \/**\n * Create the sensor class. The sensor will be set to return measurements in CM.\n * @param port\n *\/\n public EV3UltrasonicSensor(Port port)\n {\n super(port);\n }\n\n \n\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public float getRange()\n {\n return (float)port.getShort()\/10.0f;\n }\n\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public float[] getRanges()\n {\n \/\/ TODO Work out how to use other modes, maybe change this\n float [] result = new float[1];\n result[0] = getRange();\n return result;\n }\n\n}\n","subject":"Convert to use new port mechanism"} {"old_contents":"package org.example.app;\n\nimport com.hazelcast.client.config.ClientConfig;\nimport com.hazelcast.client.HazelcastClient;\nimport com.hazelcast.core.HazelcastInstance;\nimport com.hazelcast.core.IMap;\n\nimport java.util.Map;\nimport java.util.UUID;\n\npublic class PersonCache {\n private IMap map;\n private HazelcastInstance instance;\n\n public PersonCache () {\n ClientConfig cfg = new ClientConfig();\n cfg.addAddress(\"hazelcast:5701\");\n this.instance = HazelcastClient.newHazelcastClient(cfg);\n this.map = instance.getMap(\"person\");\n this.map.put(\"Anonymous\", new UUID(0, 0));\n }\n\n public boolean cachePerson (String name, UUID id) {\n System.out.println(\"Put \" + name + \":\" + id.toString() + \"to cache\");\n return this.map.putIfAbsent(name, id) == null;\n }\n\n public void forgetPerson (String name) {\n System.out.println(\"Removing \" + name + \" from cache\");\n this.map.removeAsync(name);\n }\n}\n\n","new_contents":"package org.example.app;\n\nimport com.hazelcast.client.config.ClientConfig;\nimport com.hazelcast.client.HazelcastClient;\nimport com.hazelcast.core.HazelcastInstance;\nimport com.hazelcast.core.IMap;\n\nimport java.util.Map;\nimport java.util.UUID;\n\npublic class PersonCache {\n private IMap map;\n private HazelcastInstance instance;\n\n public PersonCache () {\n ClientConfig cfg = new ClientConfig();\n cfg.addAddress(\"hazelcast:5701\");\n cfg.getGroupConfig().setName( \"app1\" ).setPassword( \"app1-pass\" );\n this.instance = HazelcastClient.newHazelcastClient(cfg);\n this.map = instance.getMap(\"person\");\n this.map.put(\"Anonymous\", new UUID(0, 0));\n }\n\n public boolean cachePerson (String name, UUID id) {\n System.out.println(\"Put \" + name + \":\" + id.toString() + \"to cache\");\n return this.map.putIfAbsent(name, id) == null;\n }\n\n public void forgetPerson (String name) {\n System.out.println(\"Removing \" + name + \" from cache\");\n this.map.removeAsync(name);\n }\n}\n\n","subject":"Set app group and password"} {"old_contents":"package org.jboss.wolf.validator.filter;\n\nimport org.jboss.wolf.validator.impl.DependencyNotFoundException;\nimport org.jboss.wolf.validator.impl.bom.BomDependencyNotFoundException;\n\npublic class BomDependencyNotFoundExceptionFilter extends DependencyNotFoundExceptionFilter {\n\n public BomDependencyNotFoundExceptionFilter(String missingArtifactRegex, String validatedArtifactRegex) {\n super(missingArtifactRegex, validatedArtifactRegex);\n }\n\n public BomDependencyNotFoundExceptionFilter(String missingArtifactRegex) {\n super(missingArtifactRegex, null);\n }\n\n @Override\n protected Class getExceptionType() {\n return BomDependencyNotFoundException.class;\n }\n\n @Override\n public String toString() {\n return \"BomDependencyNotFoundExceptionFilter{\" +\n \"missingArtifactRegex=\" + getMissingArtifactRegex() +\n \", validatedArtifactRegex=\" + getMissingArtifactRegex() +\n '}';\n }\n\n}\n","new_contents":"package org.jboss.wolf.validator.filter;\n\nimport org.jboss.wolf.validator.impl.DependencyNotFoundException;\nimport org.jboss.wolf.validator.impl.bom.BomDependencyNotFoundException;\n\npublic class BomDependencyNotFoundExceptionFilter extends DependencyNotFoundExceptionFilter {\n\n public BomDependencyNotFoundExceptionFilter(String missingArtifactRegex, String validatedArtifactRegex) {\n super(missingArtifactRegex, validatedArtifactRegex);\n }\n\n public BomDependencyNotFoundExceptionFilter(String missingArtifactRegex) {\n super(missingArtifactRegex, null);\n }\n\n @Override\n protected Class getExceptionType() {\n return BomDependencyNotFoundException.class;\n }\n\n @Override\n public String toString() {\n return \"BomDependencyNotFoundExceptionFilter{\" +\n \"missingArtifactRegex=\" + getMissingArtifactRegex() +\n \", validatedArtifactRegex=\" + getValidatedArtifactRegex() +\n '}';\n }\n\n}\n","subject":"Return correct artifact regex in toString()"} {"old_contents":"package com.thaiopensource.relaxng;\n\nimport org.xml.sax.Locator;\nimport com.thaiopensource.datatype.Datatype;\n\nclass ValuePattern extends SimplePattern {\n String str;\n Datatype dt;\n\n ValuePattern(Datatype dt, String str, Locator locator) {\n super(combineHashCode(VALUE_HASH_CODE, str.hashCode()), locator);\n this.str = str;\n }\n\n boolean matches(Atom a) {\n return a.matchesDatatypeValue(dt, str);\n }\n\n boolean samePattern(Pattern other) {\n if (getClass() != other.getClass())\n return false;\n return (dt.equals(((ValuePattern)other).dt)\n\t && str.equals(((ValuePattern)other).str));\n }\n\n void accept(PatternVisitor visitor) {\n visitor.visitValue(dt, str);\n }\n}\n","new_contents":"package com.thaiopensource.relaxng;\n\nimport org.xml.sax.Locator;\nimport com.thaiopensource.datatype.Datatype;\n\nclass ValuePattern extends SimplePattern {\n String str;\n Datatype dt;\n\n ValuePattern(Datatype dt, String str, Locator locator) {\n super(combineHashCode(VALUE_HASH_CODE, str.hashCode()), locator);\n this.dt = dt;\n this.str = str;\n }\n\n boolean matches(Atom a) {\n return a.matchesDatatypeValue(dt, str);\n }\n\n boolean samePattern(Pattern other) {\n if (getClass() != other.getClass())\n return false;\n if (!(other instanceof ValuePattern))\n return false;\n return (dt.equals(((ValuePattern)other).dt)\n\t && str.equals(((ValuePattern)other).str));\n }\n\n void accept(PatternVisitor visitor) {\n visitor.visitValue(dt, str);\n }\n}\n","subject":"Fix a couple of bugs."} {"old_contents":"package uk.org.mygrid.cagrid.servicewrapper.service.interproscan.invoker;\r\n\r\nimport uk.org.mygrid.cagrid.servicewrapper.serviceinvoker.interproscan.DummyInterProScanInvoker;\r\nimport uk.org.mygrid.cagrid.servicewrapper.serviceinvoker.interproscan.InterProScanInvoker;\r\n\r\npublic class InvokerFactory {\r\n\tprivate static InterProScanInvoker invoker;\r\n\r\n\tpublic static InterProScanInvoker getInvoker() {\r\n\t\tif (invoker == null) {\r\n\t\t\tsynchronized (InvokerFactory.class) {\r\n\t\t\t\tif (invoker == null) {\r\n\t\t\t\t\tinvoker = new DummyInterProScanInvoker();\r\n\t\t\t\t\t\/\/invoker = new InterProScanInvoker();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn invoker;\r\n\t}\r\n}\r\n","new_contents":"package uk.org.mygrid.cagrid.servicewrapper.service.interproscan.invoker;\r\n\r\nimport uk.org.mygrid.cagrid.servicewrapper.serviceinvoker.InvokerException;\r\nimport uk.org.mygrid.cagrid.servicewrapper.serviceinvoker.interproscan.InterProScanInvoker;\r\nimport uk.org.mygrid.cagrid.servicewrapper.serviceinvoker.interproscan.InterProScanInvokerImpl;\r\n\r\npublic class InvokerFactory {\r\n\tprivate static InterProScanInvoker invoker;\r\n\r\n\tpublic static InterProScanInvoker getInvoker() {\r\n\t\tif (invoker == null) {\r\n\t\t\tsynchronized (InvokerFactory.class) {\r\n\t\t\t\tif (invoker == null) {\r\n\t\t\t\t\t\/\/invoker = new DummyInterProScanInvoker();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tinvoker = new InterProScanInvokerImpl();\r\n\t\t\t\t\t} catch (InvokerException e) {\r\n\t\t\t\t\t\tthrow new RuntimeException(\"Can't instantiate InterProScan invoker\", e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn invoker;\r\n\t}\r\n}\r\n","subject":"Use real invoker by default"} {"old_contents":"\/* Generated By:JJTree: Do not edit this line. ASTText.java *\/\n\npackage org.apache.velocity.runtime.parser.node;\n\nimport java.io.Writer;\nimport java.io.IOException;\n\nimport org.apache.velocity.Context;\nimport org.apache.velocity.runtime.parser.*;\n\npublic class ASTText extends SimpleNode\n{\n private String text;\n\n public ASTText(int id)\n {\n super(id);\n }\n\n public ASTText(Parser p, int id)\n {\n super(p, id);\n }\n\n \/** Accept the visitor. **\/\n public Object jjtAccept(ParserVisitor visitor, Object data)\n {\n return visitor.visit(this, data);\n }\n\n public Object init(Context context, Object data) throws Exception\n {\n \/\/ text = NodeUtils.specialText(getFirstToken()) +\n \/\/ getFirstToken().image;\n \n \/*\n * there is only one special case we care about now : if the specialToken leads with a $\n * Everything else seems to be working right now \n *\/\n \n text = getFirstToken().image;\n \n if (NodeUtils.specialText(getFirstToken()).startsWith(\"$\") )\n text = \"$\" + text;\n \n return data;\n }\n\n public boolean render(Context context, Writer writer)\n throws IOException\n {\n writer.write(text);\n return true;\n } \n}\n","new_contents":"\/* Generated By:JJTree: Do not edit this line. ASTText.java *\/\n\npackage org.apache.velocity.runtime.parser.node;\n\nimport java.io.Writer;\nimport java.io.IOException;\n\nimport org.apache.velocity.Context;\nimport org.apache.velocity.runtime.parser.*;\n\npublic class ASTText extends SimpleNode\n{\n private String text;\n\n public ASTText(int id)\n {\n super(id);\n }\n\n public ASTText(Parser p, int id)\n {\n super(p, id);\n }\n\n \/** Accept the visitor. **\/\n public Object jjtAccept(ParserVisitor visitor, Object data)\n {\n return visitor.visit(this, data);\n }\n\n public Object init(Context context, Object data) throws Exception\n {\n \/\/ text = NodeUtils.specialText(getFirstToken()) +\n \/\/ getFirstToken().image;\n \n \/*\n * there is only one special case we care about now : if the specialToken leads with a $\n * Everything else seems to be working right now \n *\/\n \n text = getFirstToken().image;\n \n if (NodeUtils.specialText(getFirstToken()).startsWith(\"$\")) \n text = \"$\" + text;\n else if ( NodeUtils.specialText(getFirstToken()).startsWith(\"#\") )\n text = \"#\" + text;\n \n return data;\n }\n\n public boolean render(Context context, Writer writer)\n throws IOException\n {\n writer.write(text);\n return true;\n } \n}\n","subject":"Support for symmetrization of DIRECTIVE and REFERENCE. See the 1.20 Parser.jjt"} {"old_contents":"import httpserver.RequestSender;\nimport httpserver.WebServer;\nimport javafx.event.ActionEvent;\nimport javafx.fxml.FXML;\nimport javafx.scene.control.TextArea;\nimport javafx.scene.control.TextField;\n\npublic class Controller {\n public TextField command;\n @FXML\n public TextArea results;\n\n public void runCommand(ActionEvent actionEvent) {\n WebServer ws = new WebServer();\n ws.setResults(results);\n String commandString = command.getText();\n RequestSender.sendRequest(\"http:\/\/localhost:8000\/job\", \"13\", commandString, \"http:\/\/localhost:8008\/jobFinished\");\n }\n\n}\n","new_contents":"import httpserver.RequestSender;\nimport httpserver.WebServer;\nimport javafx.event.ActionEvent;\nimport javafx.fxml.FXML;\nimport javafx.scene.control.TextArea;\nimport javafx.scene.control.TextField;\n\npublic class Controller {\n private WebServer ws = new WebServer();\n public TextField command;\n @FXML\n public TextArea results;\n\n public void runCommand(ActionEvent actionEvent) {\n ws.setResults(results);\n String commandString = command.getText();\n RequestSender.sendRequest(\"http:\/\/localhost:8000\/job\", \"13\", commandString, \"http:\/\/localhost:8008\/jobFinished\");\n }\n\n}\n","subject":"Correct multiple instantiation of server problem."} {"old_contents":"package fi.helsinki.cs.tmc.cli.command;\n\nimport fi.helsinki.cs.tmc.cli.Application;\n\npublic class HelpCommand implements Command {\n private CommandMap commands;\n\n public HelpCommand(Application app) {\n this.commands = app.getCommandMap();\n }\n\n @Override\n public String getDescription() {\n return \"Lists every command\";\n }\n\n @Override\n public String getName() {\n return \"help\";\n }\n\n @Override\n public void run(String[] args) {\n System.out.println(\"TMC commands:\");\n for (Command command : this.commands.getCommands().values()) {\n System.out.println(\" \" + command.getName() + \"\\t\" + command.getDescription());\n }\n }\n}\n","new_contents":"package fi.helsinki.cs.tmc.cli.command;\n\nimport fi.helsinki.cs.tmc.cli.Application;\n\npublic class HelpCommand implements Command {\n private Application app;\n private CommandMap commands;\n\n public HelpCommand(Application app) {\n this.app = app;\n this.commands = app.getCommandMap();\n }\n\n @Override\n public String getDescription() {\n return \"Lists every command\";\n }\n\n @Override\n public String getName() {\n return \"help\";\n }\n\n @Override\n public void run(String[] args) {\n System.out.println(\"Usage: tmc-cli [args] COMMAND [command-args]\");\n System.out.println(\"\");\n System.out.println(\"TMC commands:\");\n for (Command command : this.commands.getCommands().values()) {\n System.out.println(\" \" + command.getName() + \"\\t\" + command.getDescription());\n }\n System.out.println(\"\");\n app.printHelp();\n }\n}\n","subject":"Print the cmd arguments to help message."} {"old_contents":"package seedu.emeraldo.logic.commands;\n\nimport seedu.emeraldo.model.Emeraldo;\n\n\/**\n * Clears the address book.\n *\/\npublic class ClearCommand extends Command {\n\n public static final String COMMAND_WORD = \"clear\";\n public static final String MESSAGE_SUCCESS = \"Address book has been cleared!\";\n\n public ClearCommand() {}\n\n\n @Override\n public CommandResult execute() {\n assert model != null;\n model.resetData(Emeraldo.getEmptyEmeraldo());\n return new CommandResult(MESSAGE_SUCCESS);\n }\n}\n","new_contents":"package seedu.emeraldo.logic.commands;\n\nimport seedu.emeraldo.model.Emeraldo;\n\n\/**\n * Clears the address book.\n *\/\npublic class ClearCommand extends Command {\n\n public static final String COMMAND_WORD = \"clear\";\n public static final String MESSAGE_SUCCESS = \"Emeraldo has been cleared!\";\n\n public ClearCommand() {}\n\n\n @Override\n public CommandResult execute() {\n assert model != null;\n model.resetData(Emeraldo.getEmptyEmeraldo());\n return new CommandResult(MESSAGE_SUCCESS);\n }\n}\n","subject":"Change Address book to Emeraldo"} {"old_contents":"package com.topsy.jmxproxy.resource;\n\nimport com.topsy.jmxproxy.service.JMXConnectionManager;\n\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.PathParam;\nimport javax.ws.rs.Produces;\n\nimport javax.ws.rs.core.MediaType;\nimport javax.ws.rs.core.Response;\n\nimport org.apache.log4j.Logger;\n\nimport org.springframework.stereotype.Service;\n\nimport com.sun.jersey.api.core.InjectParam;\n\n@Service\n@Path(\"\/\")\npublic class JMXProxyResource {\n private static Logger LOG = Logger.getLogger(JMXProxyResource.class);\n\n @InjectParam\n private static JMXConnectionManager manager;\n\n @GET\n @Path(\"\/{host}:{port:\\\\d+}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getJMXDataJSON(@PathParam(\"host\") String host, @PathParam(\"port\") int port) {\n LOG.debug(\"request jmx domains as json for \" + host + \":\" + port);\n\n try {\n return Response.ok(manager.getHost(host + \":\" + port)).build();\n } catch (Exception e) {\n LOG.debug(\"failed parameters: \" + host + \":\" + port, e);\n return Response.status(Response.Status.NOT_FOUND).build();\n }\n }\n}\n","new_contents":"package com.topsy.jmxproxy;\n\nimport com.topsy.jmxproxy.core.Host;\nimport com.topsy.jmxproxy.jmx.ConnectionManager;\n\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.PathParam;\nimport javax.ws.rs.Produces;\n\nimport javax.ws.rs.core.MediaType;\nimport javax.ws.rs.core.Response;\nimport javax.ws.rs.WebApplicationException;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n@Path(\"\/{host}:{port:\\\\d+}\")\n@Produces(MediaType.APPLICATION_JSON)\npublic class JMXProxyResource {\n private static final Logger LOG = LoggerFactory.getLogger(JMXProxyResource.class);\n\n private final ConnectionManager manager;\n\n public JMXProxyResource(ConnectionManager manager) {\n this.manager = manager;\n }\n\n @GET\n public Host getJMXHostData(@PathParam(\"host\") String host, @PathParam(\"port\") int port) {\n LOG.debug(\"fetching jmx data for \" + host + \":\" + port);\n\n try {\n return manager.getHost(host + \":\" + port);\n } catch (Exception e) {\n LOG.debug(\"failed parameters: \" + host + \":\" + port, e);\n throw new WebApplicationException(Response.Status.NOT_FOUND);\n }\n }\n}\n","subject":"Convert Resource to support dropwizard service."} {"old_contents":"package cafe.test;\n\nimport java.io.FileInputStream;\nimport java.io.IOException;\n\nimport cafe.image.meta.icc.ICCProfile;\n\npublic class TestICCProfile {\n\n\tpublic static void main(String[] args) throws IOException {\t\t\n\t\tFileInputStream fin = new FileInputStream(args[0]);\n\t\tICCProfile icc_profile = new ICCProfile(fin);\n\t\ticc_profile.showHeader();\n\t\ticc_profile.showTagTable();\n\t\tfin.close();\n\t}\n}","new_contents":"package cafe.test;\n\nimport java.io.FileInputStream;\nimport java.io.IOException;\n\nimport cafe.image.meta.icc.ICCProfile;\n\npublic class TestICCProfile {\n\n\tpublic static void main(String[] args) throws IOException {\t\t\n\t\tFileInputStream fin = new FileInputStream(args[0]);\n\t\tICCProfile.showProfile(fin);\n\t\tfin.close();\n\t}\n}","subject":"Change due to ICCProfile change"} {"old_contents":"package biz.paluch.logcapture.common;\n\nimport java.util.Comparator;\nimport java.util.ServiceLoader;\nimport java.util.TreeSet;\n\n\/**\n * @author
      Mark Paluch<\/a>\n *\/\npublic class Service {\n public static MessageCollectionFactory getFactory() {\n ServiceLoader loader = ServiceLoader.load(MessageCollectionFactory.class);\n\n TreeSet factories = new TreeSet(\n new Comparator() {\n @Override\n public int compare(MessageCollectionFactory o1, MessageCollectionFactory o2) {\n if (o1.priority() > o2.priority()) {\n return 1;\n }\n if (o1.priority() < o2.priority()) {\n return -1;\n }\n return 0;\n }\n });\n\n for (MessageCollectionFactory messageCollectionFactory : loader) {\n factories.add(messageCollectionFactory);\n }\n\n if (factories.isEmpty()) {\n throw new IllegalStateException(\"Cannot retrieve a \" + MessageCollectionFactory.class.getName()\n + \". Please add logcapture modules or create a service extension.\");\n }\n return factories.first();\n }\n}\n","new_contents":"package biz.paluch.logcapture.common;\n\nimport java.util.Comparator;\nimport java.util.ServiceLoader;\nimport java.util.TreeSet;\n\n\/**\n * @author Mark Paluch<\/a>\n *\/\npublic class Service {\n public static MessageCollectionFactory getFactory() {\n ServiceLoader loader = ServiceLoader.load(MessageCollectionFactory.class);\n\n TreeSet factories = new TreeSet(\n new Comparator() {\n @Override\n public int compare(MessageCollectionFactory o1, MessageCollectionFactory o2) {\n if (o1.priority() > o2.priority()) {\n return -1;\n }\n if (o1.priority() < o2.priority()) {\n return 1;\n }\n return 0;\n }\n });\n\n for (MessageCollectionFactory messageCollectionFactory : loader) {\n factories.add(messageCollectionFactory);\n }\n\n if (factories.isEmpty()) {\n throw new IllegalStateException(\"Cannot retrieve a \" + MessageCollectionFactory.class.getName()\n + \". Please add logcapture modules or create a service extension.\");\n }\n return factories.first();\n }\n}\n","subject":"Use priority ordering low to high"} {"old_contents":"package io.cozmic.usher.pipeline;\n\nimport de.odysseus.el.util.SimpleContext;\nimport io.cozmic.usher.core.MessageMatcher;\nimport io.cozmic.usher.message.PipelinePack;\n\nimport javax.el.ExpressionFactory;\nimport javax.el.ValueExpression;\n\n\/**\n * Created by chuck on 7\/3\/15.\n *\/\npublic class JuelMatcher implements MessageMatcher {\n\n private static ExpressionFactory factory = ExpressionFactory.newInstance();\n private SimpleContext context = new SimpleContext();\n private ValueExpression expression;\n\n public JuelMatcher(String expressionVal) {\n expression = factory.createValueExpression(context, expressionVal, boolean.class);\n }\n\n @Override\n public boolean matches(PipelinePack pipelinePack) {\n SimpleContext runtimeContext = new SimpleContext();\n final Object msg = pipelinePack.getMessage();\n factory.createValueExpression(runtimeContext, \"${msgClassSimpleName}\", String.class).setValue(runtimeContext, msg.getClass().getSimpleName());\n factory.createValueExpression(runtimeContext, \"${msg}\", msg.getClass()).setValue(runtimeContext, msg);\n return (boolean) expression.getValue(runtimeContext);\n }\n}\n","new_contents":"package io.cozmic.usher.pipeline;\n\nimport de.odysseus.el.util.SimpleContext;\nimport io.cozmic.usher.core.MessageMatcher;\nimport io.cozmic.usher.message.PipelinePack;\n\nimport javax.el.ExpressionFactory;\nimport javax.el.ValueExpression;\n\n\/**\n * Created by chuck on 7\/3\/15.\n *\/\npublic class JuelMatcher implements MessageMatcher {\n\n private static ExpressionFactory factory = ExpressionFactory.newInstance();\n private SimpleContext context = new SimpleContext();\n private ValueExpression expression;\n\n public JuelMatcher(String expressionVal) {\n expression = factory.createValueExpression(context, expressionVal, boolean.class);\n }\n\n @Override\n public boolean matches(PipelinePack pipelinePack) {\n SimpleContext runtimeContext = new SimpleContext();\n final Object msg = pipelinePack.getMessage();\n if (msg != null) {\n factory.createValueExpression(runtimeContext, \"${msgClassSimpleName}\", String.class).setValue(runtimeContext, msg.getClass().getSimpleName());\n factory.createValueExpression(runtimeContext, \"${msg}\", msg.getClass()).setValue(runtimeContext, msg);\n }\n return (boolean) expression.getValue(runtimeContext);\n }\n}\n","subject":"Fix messageMatcher in situations where message is null"} {"old_contents":"package de.bmoth.typechecker;\n\nimport de.bmoth.parser.Parser;\nimport de.bmoth.parser.ast.TypeErrorException;\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertTrue;\nimport static org.junit.Assert.fail;\n\npublic class TypeErrorExceptionTest {\n\n @Test(expected = TypeErrorException.class)\n public void testTypeErrorException() {\n String formula = \"a = TRUE & b = 1 & a = b\";\n Parser.getFormulaAsSemanticAst(formula);\n }\n\n @Test(expected = TypeErrorException.class)\n public void testTypeErrorException2() {\n String formula = \"a = TRUE & a = 1 + 1\";\n Parser.getFormulaAsSemanticAst(formula);\n }\n\n @Test\n public void testSetEnumeration() {\n String formula = \"x = {1,2,(3,4)}\";\n String exceptionMessage = getExceptionMessage(formula);\n assertTrue(exceptionMessage != null &&exceptionMessage.contains(\"Expected INTEGER but found INTEGER*INTEGER\"));\n }\n\n @Test\n public void testSetEnumeration2() {\n String formula = \"x = {1,2,{3,4}}\";\n String exceptionMessage = getExceptionMessage(formula);\n assertTrue(exceptionMessage != null &&exceptionMessage.contains(\"found POW\"));\n }\n\n private static String getExceptionMessage(String formula) {\n try {\n Parser.getFormulaAsSemanticAst(formula);\n fail(\"Expected a type error exception.\");\n return \"\";\n } catch (TypeErrorException e) {\n return e.getMessage();\n }\n }\n}\n","new_contents":"package de.bmoth.typechecker;\n\nimport de.bmoth.parser.Parser;\nimport de.bmoth.parser.ast.TypeErrorException;\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertTrue;\nimport static org.junit.Assert.fail;\n\npublic class TypeErrorExceptionTest {\n\n @Test(expected = TypeErrorException.class)\n public void testTypeErrorException() {\n String formula = \"a = TRUE & b = 1 & a = b\";\n Parser.getFormulaAsSemanticAst(formula);\n }\n\n @Test(expected = TypeErrorException.class)\n public void testTypeErrorException2() {\n String formula = \"a = TRUE & a = 1 + 1\";\n Parser.getFormulaAsSemanticAst(formula);\n }\n\n @Test\n public void testSetEnumeration() {\n String formula = \"x = {1,2,(3,4)}\";\n String exceptionMessage = getExceptionMessage(formula);\n assertTrue(exceptionMessage.contains(\"Expected INTEGER but found INTEGER*INTEGER\"));\n }\n\n @Test\n public void testSetEnumeration2() {\n String formula = \"x = {1,2,{3,4}}\";\n String exceptionMessage = getExceptionMessage(formula);\n assertTrue(exceptionMessage.contains(\"found POW\"));\n }\n\n private static String getExceptionMessage(String formula) {\n try {\n Parser.getFormulaAsSemanticAst(formula);\n fail(\"Expected a type error exception.\");\n return \"\";\n } catch (TypeErrorException e) {\n return e.getMessage();\n }\n }\n}\n","subject":"Revert \"fix \"NullPionterException could be thrown\"-bug, see sonar qube L28, L35\""} {"old_contents":"package org.codehaus.xfire.exchange;\n\nimport javax.xml.stream.XMLStreamReader;\n\n\/**\n * A \"in\" message. These arrive at endpoints.\n\n * @author Dan Diephouse<\/a>\n *\/\npublic class InMessage\n extends AbstractMessage\n{\n private XMLStreamReader xmlStreamReader;\n\n public InMessage()\n {\n }\n \n public InMessage(XMLStreamReader xmlStreamReader)\n {\n this.xmlStreamReader = xmlStreamReader;\n setUri(ANONYMOUS_URI);\n }\n \n public InMessage(XMLStreamReader xmlStreamReader, String uri)\n {\n this.xmlStreamReader = xmlStreamReader;\n setUri(uri);\n }\n\n public XMLStreamReader getXMLStreamReader()\n {\n return xmlStreamReader;\n }\n}","new_contents":"package org.codehaus.xfire.exchange;\n\nimport javax.xml.stream.XMLStreamReader;\n\n\/**\n * A \"in\" message. These arrive at endpoints.\n\n * @author Dan Diephouse<\/a>\n *\/\npublic class InMessage\n extends AbstractMessage\n{\n private XMLStreamReader xmlStreamReader;\n\n public InMessage()\n {\n }\n \n public InMessage(XMLStreamReader xmlStreamReader)\n {\n this.xmlStreamReader = xmlStreamReader;\n setUri(ANONYMOUS_URI);\n }\n \n public InMessage(XMLStreamReader xmlStreamReader, String uri)\n {\n this.xmlStreamReader = xmlStreamReader;\n setUri(uri);\n }\n\n public void setXMLStreamReader(XMLStreamReader xmlStreamReader)\n {\n this.xmlStreamReader = xmlStreamReader;\n }\n\n public XMLStreamReader getXMLStreamReader()\n {\n return xmlStreamReader;\n }\n}","subject":"Allow the stream reader to be set"} {"old_contents":"package seedu.todo.ui;\n\nimport seedu.todo.controllers.*;\n\npublic class InputHandler {\n \n Controller handlingController = null;\n \n public boolean processInput(String input) {\n if (this.handlingController != null) {\n handlingController.process(input);\n } else {\n Controller[] controllers = instantiateAllControllers();\n \n \/\/ Define the controller which returns the maximum confidence.\n Controller maxController = null;\n \n \/\/ Get controller which has the maximum confidence.\n float maxConfidence = Integer.MIN_VALUE;\n \n for (int i = 0; i < controllers.length; i++) {\n float confidence = controllers[i].inputConfidence(input);\n \n \/\/ Don't consider controllers with non-positive confidence.\n if (confidence <= 0)\n continue;\n \n if (confidence > maxConfidence) {\n maxConfidence = confidence;\n maxController = controllers[i];\n }\n }\n \n \/\/ No controller exists with confidence > 0.\n if (maxController == null)\n return false;\n \n \/\/ Process using best-matched controller.\n maxController.process(input);\n \n }\n \n return true;\n }\n \n private Controller[] instantiateAllControllers() {\n return new Controller[] { new AddController(),\n new ListController(),\n new DestroyController(),\n new UpdateController() };\n }\n\n}\n","new_contents":"package seedu.todo.ui;\n\nimport seedu.todo.controllers.*;\n\npublic class InputHandler {\n\n Controller handlingController = null;\n\n public boolean processInput(String input) {\n if (this.handlingController != null) {\n handlingController.process(input);\n } else {\n Controller[] controllers = instantiateAllControllers();\n\n \/\/ Define the controller which returns the maximum confidence.\n Controller maxController = null;\n\n \/\/ Get controller which has the maximum confidence.\n float maxConfidence = Integer.MIN_VALUE;\n\n for (int i = 0; i < controllers.length; i++) {\n float confidence = controllers[i].inputConfidence(input);\n\n \/\/ Don't consider controllers with non-positive confidence.\n if (confidence <= 0) {\n continue;\n }\n\n if (confidence > maxConfidence) {\n maxConfidence = confidence;\n maxController = controllers[i];\n }\n }\n\n \/\/ No controller exists with confidence > 0.\n if (maxController == null) {\n return false;\n }\n\n \/\/ Process using best-matched controller.\n maxController.process(input);\n\n }\n\n return true;\n }\n \n private Controller[] instantiateAllControllers() {\n return new Controller[] { new AddController(),\n new ListController(),\n new DestroyController(),\n new UpdateController() };\n }\n\n}\n","subject":"Fix spacing and conditional braces"} {"old_contents":"\/*\n * $Id$\n *\n * Copyright 2011 samaxes.com\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.samaxes.filter.util;\n\n\/**\n * Enumeration of the possible configuration parameters.\n * \n * @author Samuel Santos\n * @version $Revision$\n *\/\npublic enum CacheConfigParameter {\n \/** Defines whether a component is static or not. *\/\n STATIC(\"static\"),\n \/** Cache directive to control where the response may be cached. *\/\n PRIVATE(\"private\"),\n \/** Cache directive to set an expiration date relative to the current date. *\/\n EXPIRATION_TIME(\"expirationTime\");\n\n private String name;\n\n private CacheConfigParameter(String name) {\n this.name = name;\n }\n\n \/**\n * Gets the parameter name.\n * \n * @return the parameter name\n *\/\n public String getName() {\n return this.name;\n }\n}\n","new_contents":"\/*\n *\n * Copyright 2011 samaxes.com\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.samaxes.filter.util;\n\n\/**\n * Enumeration of the possible configuration parameters.\n *\n * @author Samuel Santos\n * @author John Yeary\n * @version 2.0.1\n *\/\npublic enum CacheConfigParameter {\n\n \/**\n * Defines whether a component is static or not.\n *\/\n STATIC(\"static\"),\n \/**\n * Cache directive to control where the response may be cached.\n *\/\n PRIVATE(\"private\"),\n \/**\n * Cache directive to set an expiration date relative to the current date.\n *\/\n EXPIRATION_TIME(\"expirationTime\");\n\n private final String name;\n\n private CacheConfigParameter(String name) {\n this.name = name;\n }\n\n \/**\n * Gets the parameter name.\n *\n * @return the parameter name\n *\/\n public String getName() {\n return this.name;\n }\n}\n","subject":"Set the name to final."} {"old_contents":"package nl.codecastle.configuration;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Properties;\n\n\/**\n * Reads properties file from a given location.\n *\/\npublic class PropertiesReader {\n\n private final Properties properties;\n private final Properties defaultProperties;\n\n \/**\n * Reads in the properties from the given path.\n * Also reads in the defaults properties from the \"default.properties\" file.\n *\n * @param filePath the path of the project properties file\n *\/\n public PropertiesReader(String filePath) {\n\n properties = new Properties();\n defaultProperties = new Properties();\n\n try {\n ClassLoader classLoader = getClass().getClassLoader();\n InputStream defaultPropertiesStream = classLoader.getResourceAsStream(\"default.properties\");\n InputStream projectPropertiesStream = classLoader.getResourceAsStream(filePath);\n assert (defaultPropertiesStream != null);\n defaultProperties.load(defaultPropertiesStream);\n if (projectPropertiesStream != null) {\n properties.load(projectPropertiesStream);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n \/**\n * Returns the value for the given key from the project properties file.\n * If the file is missing it retrieves a value from the default properties.\n *\n * @param key name of the property needed\n * @return the value for the given key\n *\/\n public String getValue(String key) {\n if (properties.containsKey(key)) {\n return properties.getProperty(key);\n } else {\n return defaultProperties.getProperty(key);\n }\n }\n}\n","new_contents":"package nl.codecastle.configuration;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Properties;\n\n\/**\n * Reads properties file from a given location.\n *\/\npublic class PropertiesReader {\n\n private final Properties properties;\n private final Properties defaultProperties;\n\n \/**\n * Reads in the properties from the given path.\n * Also reads in the defaults properties from the \"default.properties\" file.\n *\n * @param filePath the path of the project properties file\n *\/\n public PropertiesReader(String filePath) {\n\n properties = new Properties();\n defaultProperties = new Properties();\n\n try {\n InputStream defaultPropertiesStream = getClass().getClassLoader().getResourceAsStream(\"default.properties\");\n InputStream projectPropertiesStream = getClass().getClassLoader().getResourceAsStream(filePath);\n assert (defaultPropertiesStream != null);\n defaultProperties.load(defaultPropertiesStream);\n if (projectPropertiesStream != null) {\n properties.load(projectPropertiesStream);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n \/**\n * Returns the value for the given key from the project properties file.\n * If the file is missing it retrieves a value from the default properties.\n *\n * @param key name of the property needed\n * @return the value for the given key\n *\/\n public String getValue(String key) {\n if (properties.containsKey(key)) {\n return properties.getProperty(key);\n } else {\n return defaultProperties.getProperty(key);\n }\n }\n}\n","subject":"Read properties from a property file"} {"old_contents":"package org.zendesk.client.v2.model;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\n\n\/**\n * @author stephenc\n * @since 04\/04\/2013 14:53\n *\/\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class CustomFieldValue {\n private Long id;\n private String value;\n\n public Long getId() {\n return id;\n }\n\n public void setId(Long id) {\n this.id = id;\n }\n\n public String getValue() {\n return value;\n }\n\n public void setValue(String value) {\n this.value = value;\n }\n}\n","new_contents":"package org.zendesk.client.v2.model;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\n\n\/**\n * @author stephenc\n * @since 04\/04\/2013 14:53\n *\/\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class CustomFieldValue {\n private Long id;\n private String value;\n\n public CustomFieldValue() {\n }\n\n public CustomFieldValue(Long id, String value) {\n this.id = id;\n this.value = value;\n }\n\n public Long getId() {\n return id;\n }\n\n public void setId(Long id) {\n this.id = id;\n }\n\n public String getValue() {\n return value;\n }\n\n public void setValue(String value) {\n this.value = value;\n }\n}\n","subject":"Add a constructor to ease setting custom fields"} {"old_contents":"\/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage org.opensim.threejs;\n\nimport org.opensim.modeling.GeometryPath;\nimport org.opensim.modeling.State;\nimport org.opensim.modeling.Vec3;\n\n\/**\n *\n * @author Ayman-NMBL\n * \n * Default ColorMap for earlier versions of OpenSim red-to-blue 0-1\n * RGB components scales linearly\n *\/\npublic class ModernPathColorMap implements PathColorMap {\n\n @Override\n public Vec3 getColor(GeometryPath path, State state) {\n Vec3 activationBasedColor = path.getColor(state);\n double redness = activationBasedColor.get(0);\n Vec3 mappedColor = new Vec3(0.6435 + 0.07588*redness,\n 0.7009 - 0.6396*redness,\n 0.8554 - 0.6891*redness);\n return mappedColor;\n }\n \n}\n","new_contents":"\/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage org.opensim.threejs;\n\nimport java.util.prefs.Preferences;\nimport org.opensim.modeling.GeometryPath;\nimport org.opensim.modeling.State;\nimport org.opensim.modeling.Vec3;\nimport org.opensim.utils.TheApp;\n\n\/**\n *\n * @author Ayman-NMBL\n * \n * Default ColorMap for earlier versions of OpenSim red-to-blue 0-1\n * RGB components scales linearly\n *\/\npublic class ModernPathColorMap implements PathColorMap {\n double weight = 0.0;\n \n void updateWeight (){\n String weightString=\"0.\";\n String saved=Preferences.userNodeForPackage(TheApp.class).get(\"ColorMap Weight\", weightString);\n Preferences.userNodeForPackage(TheApp.class).put(\"ColorMap Weight\", saved);\n weight = Double.parseDouble(saved);\n }\n\n @Override\n public Vec3 getColor(GeometryPath path, State state) {\n updateWeight ();\n Vec3 activationBasedColor = path.getColor(state);\n double redness = activationBasedColor.get(0);\n Vec3 mappedColor = new Vec3(0.6435 + 0.07588*redness,\n 0.7009 - 0.6396*redness,\n 0.8554 - 0.6891*redness);\n Vec3 rawColor = new Vec3(redness, 0, 1-redness);\n Vec3 weightedColor = new Vec3();\n for (int i=0; i<3; i++)\n weightedColor.set(i, weight*rawColor.get(i)+(1 - weight)*mappedColor.get(i));\n return weightedColor;\n }\n \n}\n","subject":"Introduce blending weight to tune muscle colors"} {"old_contents":"package codechicken.lib.block.property;\n\nimport com.google.common.base.Optional;\nimport com.google.common.collect.ImmutableSet;\nimport com.google.common.collect.Lists;\nimport net.minecraft.block.properties.PropertyHelper;\n\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.List;\n\n\/**\n * Created by covers1624 on 2\/6\/2016.\n *\/\npublic class PropertyString extends PropertyHelper {\n\n private final HashSet valuesSet;\n\n public PropertyString(String name, Collection values) {\n super(name, String.class);\n valuesSet = new HashSet(values);\n }\n\n public PropertyString(String name, String... values) {\n super(name, String.class);\n valuesSet = new HashSet();\n Collections.addAll(valuesSet, values);\n }\n\n public List values() {\n return Lists.newLinkedList(valuesSet);\n }\n\n @Override\n public Collection getAllowedValues() {\n return ImmutableSet.copyOf(valuesSet);\n }\n\n @Override\n public Optional parseValue(String value) {\n if (valuesSet.contains(value)) {\n return Optional.of(value);\n }\n return Optional.absent();\n }\n\n @Override\n public String getName(String value) {\n return value;\n }\n}\n\n","new_contents":"package codechicken.lib.block.property;\n\nimport com.google.common.base.Optional;\nimport com.google.common.collect.ImmutableList;\nimport net.minecraft.block.properties.PropertyHelper;\n\nimport java.util.*;\n\n\/**\n * Created by covers1624 on 2\/6\/2016.\n *\/\npublic class PropertyString extends PropertyHelper {\n\n private final List valuesSet;\n\n public PropertyString(String name, Collection values) {\n super(name, String.class);\n valuesSet = new LinkedList(values);\n }\n\n public PropertyString(String name, String... values) {\n super(name, String.class);\n valuesSet = new LinkedList();\n Collections.addAll(valuesSet, values);\n }\n\n public List values() {\n return ImmutableList.copyOf(valuesSet);\n }\n\n @Override\n public Collection getAllowedValues() {\n return ImmutableList.copyOf(valuesSet);\n }\n\n @Override\n public Optional parseValue(String value) {\n if (valuesSet.contains(value)) {\n return Optional.of(value);\n }\n return Optional.absent();\n }\n\n @Override\n public String getName(String value) {\n return value;\n }\n}\n\n","subject":"Move property string to use a linked list."} {"old_contents":"\/*\n * Copyright 2015 Ryan Gilera.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.github.daytron.revworks.data;\n\n\/**\n * Collection of exception messages.\n *\n * @author Ryan Gilera\n *\/\npublic enum ExceptionMsg {\n\n AUTHENTICATION_EXCEPTION_NO_USER(\"No such user found. Invalid credentials.\"),\n AUTHENTICATION_EXCEPTION_SYS_ERROR(\"System error occured, \"\n + \"please consult your administrator for help.\"),\n NO_CURRENT_USER_EXCEPTION(\"No user is login\"),\n WRONG_CURRENT_USER_TYPE_EXCEPTION(\"Wrong user type access.\");\n private final String msg;\n\n private ExceptionMsg(String msg) {\n this.msg = msg;\n }\n\n public String getMsg() {\n return msg;\n }\n\n}\n","new_contents":"\/*\n * Copyright 2015 Ryan Gilera.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.github.daytron.revworks.data;\n\n\/**\n * Collection of exception messages.\n *\n * @author Ryan Gilera\n *\/\npublic enum ExceptionMsg {\n\n AUTHENTICATION_EXCEPTION_NO_USER(\"No such user found. Invalid credentials.\"),\n AUTHENTICATION_EXCEPTION_SYS_ERROR(\"System error occured \"),\n NO_CURRENT_USER_EXCEPTION(\"No user is login\"),\n WRONG_CURRENT_USER_TYPE_EXCEPTION(\"Wrong user type access.\"),\n EMPTY_SQL_RESULT(\"Empty SQL query result.\");\n private final String msg;\n\n private ExceptionMsg(String msg) {\n this.msg = msg;\n }\n\n public String getMsg() {\n return msg;\n }\n\n}\n","subject":"Add empty result sql query message and move instruction to ErrorMsg"} {"old_contents":"package org.dstadler.jgit;\n\n\/*\n Copyright 2013, 2014 Dominik Stadler\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n *\/\n\nimport java.io.File;\nimport java.io.IOException;\n\nimport org.apache.commons.io.FileUtils;\nimport org.eclipse.jgit.lib.Repository;\nimport org.eclipse.jgit.storage.file.FileRepositoryBuilder;\n\n\/**\n * Simple snippet which shows how to create a new repository\n * \n * @author dominik.stadler at gmx.at\n *\/\npublic class CreateNewRepository {\n\n public static void main(String[] args) throws IOException {\n \/\/ prepare a new folder\n File localPath = File.createTempFile(\"TestGitRepository\", \"\");\n localPath.delete();\n\n \/\/ create the directory\n Repository repository = FileRepositoryBuilder.create(new File(localPath, \".git\"));\n repository.create();\n\n System.out.println(\"Having repository: \" + repository.getDirectory());\n\n repository.close();\n\n FileUtils.deleteDirectory(localPath);\n }\n}\n","new_contents":"package org.dstadler.jgit;\n\n\/*\n Copyright 2013, 2014 Dominik Stadler\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n *\/\n\nimport java.io.File;\nimport java.io.IOException;\n\nimport org.apache.commons.io.FileUtils;\nimport org.eclipse.jgit.api.Git;\nimport org.eclipse.jgit.api.errors.GitAPIException;\n\n\/**\n * Simple snippet which shows how to create a new repository\n *\n * @author dominik.stadler at gmx.at\n *\/\npublic class CreateNewRepository {\n\n public static void main(String[] args) throws IOException, IllegalStateException, GitAPIException {\n \/\/ prepare a new folder\n File localPath = File.createTempFile(\"TestGitRepository\", \"\");\n localPath.delete();\n\n \/\/ create the directory\n Git git = Git.init().setDirectory(localPath).call();\n\n System.out.println(\"Having repository: \" + git.getRepository().getDirectory());\n\n git.close();\n\n FileUtils.deleteDirectory(localPath);\n }\n}\n","subject":"Rewrite example to use preferred way of creating a new repository"} {"old_contents":"\/* Copyright © 2016 Matthew Champion\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and\/or other materials provided with the distribution.\n * Neither the name of mattunderscore.com nor the\n names of its contributors may be used to endorse or promote products\n derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL MATTHEW CHAMPION BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *\/\n\npackage com.mattunderscore.specky.model;\n\nimport java.util.List;\n\n\/**\n * @author Matt Champion on 11\/06\/2016\n *\/\npublic interface TypeDesc {\n String getName();\n\n List getProperties();\n}\n","new_contents":"\/* Copyright © 2016 Matthew Champion\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and\/or other materials provided with the distribution.\n * Neither the name of mattunderscore.com nor the\n names of its contributors may be used to endorse or promote products\n derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL MATTHEW CHAMPION BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *\/\n\npackage com.mattunderscore.specky.model;\n\nimport java.util.List;\n\n\/**\n * @author Matt Champion on 11\/06\/2016\n *\/\npublic interface TypeDesc {\n String getName();\n\n List getProperties();\n\n ConstructionDesc getConstruction();\n}\n","subject":"Move construction method accessor to interface."} {"old_contents":"\/*\n * Copyright (c) 2017, Adam \n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and\/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\npackage net.runelite.api.mixins;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n@Retention(RetentionPolicy.RUNTIME)\n@Target({ElementType.METHOD, ElementType.FIELD})\npublic @interface Inject\n{\n\n}\n","new_contents":"\/*\n * Copyright (c) 2017, Adam \n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and\/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\npackage net.runelite.api.mixins;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n@Retention(RetentionPolicy.RUNTIME)\n@Target({ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR})\npublic @interface Inject\n{\n\n}\n","subject":"Allow injection of and "} {"old_contents":"package com.csforge.sstable;\n\nimport com.google.common.base.Strings;\n\nimport java.io.IOException;\nimport java.util.Arrays;\n\npublic class Driver {\n public static void main(String ... args) {\n if (args.length == 0) {\n printCommands();\n System.exit(-1);\n }\n switch(args[0].toLowerCase()) {\n case \"tojson\":\n SSTable2Json.main(Arrays.copyOfRange(args, 1, args.length));\n break;\n\n case \"select\":\n Query.main(Arrays.copyOfRange(args, 0, args.length));\n break;\n\n case \"cqlsh\":\n Cqlsh.main(Arrays.copyOfRange(args, 1, args.length));\n break;\n\n case \"describe\":\n String path = args[1];\n try {\n System.out.println(\"\\u001B[1;34m\" + path);\n System.out.println(TableTransformer.ANSI_CYAN + Strings.repeat(\"=\", path.length()));\n System.out.print(TableTransformer.ANSI_RESET);\n CassandraUtils.printStats(path, System.out);\n } catch (Exception e) {\n e.printStackTrace();\n }\n break;\n\n default:\n System.err.println(\"Unknown command: \" + args[0]);\n printCommands();\n System.exit(-2);\n break;\n }\n }\n\n private static void printCommands() {\n System.err.println(\"Available commands: cqlsh, toJson, select, describe\");\n }\n}\n","new_contents":"package com.csforge.sstable;\n\nimport com.google.common.base.Strings;\n\nimport java.io.File;\nimport java.util.Arrays;\n\npublic class Driver {\n public static void main(String ... args) {\n if (args.length == 0) {\n printCommands();\n System.exit(-1);\n }\n switch(args[0].toLowerCase()) {\n case \"tojson\":\n SSTable2Json.main(Arrays.copyOfRange(args, 1, args.length));\n break;\n\n case \"select\":\n Query.main(Arrays.copyOfRange(args, 0, args.length));\n break;\n\n case \"cqlsh\":\n Cqlsh.main(Arrays.copyOfRange(args, 1, args.length));\n break;\n\n case \"describe\":\n String path = new File(args[1]).getAbsolutePath();\n try {\n System.out.println(\"\\u001B[1;34m\" + path);\n System.out.println(TableTransformer.ANSI_CYAN + Strings.repeat(\"=\", path.length()));\n System.out.print(TableTransformer.ANSI_RESET);\n CassandraUtils.printStats(path, System.out);\n } catch (Exception e) {\n e.printStackTrace();\n }\n break;\n\n default:\n System.err.println(\"Unknown command: \" + args[0]);\n printCommands();\n System.exit(-2);\n break;\n }\n }\n\n private static void printCommands() {\n System.err.println(\"Available commands: cqlsh, toJson, select, describe\");\n }\n}\n","subject":"Use absolute path for 'describe'."} {"old_contents":"package net.aeten.core.spi;\n\n\/**\n *\n * @author Thomas Pérennou\n *\/\npublic @interface Configuration {\n\tString name();\n\tClass provider();\n\tString parser() default \"\";\n}\n","new_contents":"package net.aeten.core.spi;\n\nimport java.lang.annotation.Documented;\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n\/**\n *\n * @author Thomas Pérennou\n *\/\n@Documented\n@Retention(RetentionPolicy.SOURCE)\n@Target({ElementType.PACKAGE, ElementType.TYPE})\npublic @interface Configuration {\n\tString name();\n\tClass provider();\n\tString parser() default \"\";\n}\n","subject":"Add Documented, Retention and Target annotations"} {"old_contents":"\/*\n * This file is part of the Yildiz-Engine project, licenced under the MIT License (MIT)\n *\n * Copyright (c) 2017 Grégory Van den Borre\n *\n * More infos available: https:\/\/www.yildiz-games.be\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without\n * limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies\n * of the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial\n * portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\/\n\npackage be.yildiz.shared.mission.task;\n\n\/**\n * @author Grégory Van den Borre\n *\/\npublic class TaskTypeConstant {\n\n public static final String DESTINATION = \"destination\";\n\n public static final String DESTROY = \"destroy\";\n}\n","new_contents":"\/*\n * This file is part of the Yildiz-Engine project, licenced under the MIT License (MIT)\n *\n * Copyright (c) 2017 Grégory Van den Borre\n *\n * More infos available: https:\/\/www.yildiz-games.be\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without\n * limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies\n * of the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial\n * portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\/\n\npackage be.yildiz.shared.mission.task;\n\n\/**\n * @author Grégory Van den Borre\n *\/\npublic class TaskTypeConstant {\n\n public static final String DESTINATION = \"destination\";\n\n public static final String DESTROY = \"destroy\";\n\n private TaskTypeConstant() {\n super();\n }\n}\n","subject":"Fix sonar: add private constructor."} {"old_contents":"package me.prettyprint.cassandra.service;\n\nimport static me.prettyprint.cassandra.utils.StringUtils.bytes;\nimport static me.prettyprint.cassandra.utils.StringUtils.string;\n\nimport org.apache.cassandra.service.Column;\nimport org.apache.cassandra.service.ColumnPath;\n\n\/**\n * Example client that uses the cassandra hector client.\n *\n * @author Ran Tavory (rantav@gmail.com)\n *\n *\/\npublic class ExampleClient {\n\n public static void main(String[] args) throws IllegalStateException, PoolExhaustedException, Exception {\n CassandraClientPool pool = CassandraClientPoolFactory.INSTANCE.get();\n CassandraClient client = pool.borrowClient(\"tush\", 9160);\n try {\n Keyspace keyspace = client.getKeyspace(\"Keyspace1\");\n ColumnPath columnPath = new ColumnPath(\"Standard1\", null, bytes(\"column-name\"));\n\n \/\/ insert\n keyspace.insert(\"key\", columnPath, bytes(\"value\"));\n\n \/\/ read\n Column col = keyspace.getColumn(\"key\", columnPath);\n\n System.out.println(\"Read from cassandra: \" + string(col.getValue()));\n\n } finally {\n \/\/ return client to pool. do it in a finally block to make sure it's executed\n pool.releaseClient(client);\n }\n }\n}\n","new_contents":"package me.prettyprint.cassandra.service;\n\nimport static me.prettyprint.cassandra.utils.StringUtils.bytes;\nimport static me.prettyprint.cassandra.utils.StringUtils.string;\n\nimport org.apache.cassandra.service.Column;\nimport org.apache.cassandra.service.ColumnPath;\n\n\/**\n * Example client that uses the cassandra hector client.\n *\n * @author Ran Tavory (rantav@gmail.com)\n *\n *\/\npublic class ExampleClient {\n\n public static void main(String[] args) throws IllegalStateException, PoolExhaustedException, Exception {\n CassandraClientPool pool = CassandraClientPoolFactory.INSTANCE.get();\n CassandraClient client = pool.borrowClient(\"tush\", 9160);\n \/\/ A load balanced version would look like this:\n \/\/ CassandraClient client = pool.borrowClient(new String[] {\"cas1:9160\", \"cas2:9160\", \"cas3:9160\"});\n\n try {\n Keyspace keyspace = client.getKeyspace(\"Keyspace1\");\n ColumnPath columnPath = new ColumnPath(\"Standard1\", null, bytes(\"column-name\"));\n\n \/\/ insert\n keyspace.insert(\"key\", columnPath, bytes(\"value\"));\n\n \/\/ read\n Column col = keyspace.getColumn(\"key\", columnPath);\n\n System.out.println(\"Read from cassandra: \" + string(col.getValue()));\n\n } finally {\n \/\/ return client to pool. do it in a finally block to make sure it's executed\n pool.releaseClient(client);\n }\n }\n}\n","subject":"Add a load balanced client example"} {"old_contents":"\/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.facebook.litho.testing.testrunner;\n\nimport com.facebook.litho.config.ComponentsConfiguration;\nimport org.junit.runners.model.FrameworkMethod;\n\npublic class SplitBuildAndLayoutTestRunConfiguration implements LithoTestRunConfiguration {\n\n private final boolean defaultApplyStateUpdateEarly =\n ComponentsConfiguration.applyStateUpdateEarly;\n private final boolean defaultIsBuildAndLayoutSplitEnabled =\n ComponentsConfiguration.isBuildAndLayoutSplitEnabled;\n\n @Override\n public void beforeTest(FrameworkMethod method) {\n ComponentsConfiguration.isBuildAndLayoutSplitEnabled = true;\n ComponentsConfiguration.applyStateUpdateEarly = true;\n }\n\n @Override\n public void afterTest(FrameworkMethod method) {\n ComponentsConfiguration.isBuildAndLayoutSplitEnabled = defaultIsBuildAndLayoutSplitEnabled;\n ComponentsConfiguration.applyStateUpdateEarly = defaultApplyStateUpdateEarly;\n }\n}\n","new_contents":"\/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.facebook.litho.testing.testrunner;\n\nimport com.facebook.litho.config.ComponentsConfiguration;\nimport org.junit.runners.model.FrameworkMethod;\n\npublic class SplitBuildAndLayoutTestRunConfiguration implements LithoTestRunConfiguration {\n\n private final boolean defaultApplyStateUpdateEarly =\n ComponentsConfiguration.applyStateUpdateEarly;\n private final boolean defaultIsBuildAndLayoutSplitEnabled =\n ComponentsConfiguration.isBuildAndLayoutSplitEnabled;\n private final boolean defaultUseResolvedTree = ComponentsConfiguration.useResolvedTree;\n\n @Override\n public void beforeTest(FrameworkMethod method) {\n ComponentsConfiguration.isBuildAndLayoutSplitEnabled = true;\n ComponentsConfiguration.applyStateUpdateEarly = true;\n ComponentsConfiguration.useResolvedTree = true;\n }\n\n @Override\n public void afterTest(FrameworkMethod method) {\n ComponentsConfiguration.isBuildAndLayoutSplitEnabled = defaultIsBuildAndLayoutSplitEnabled;\n ComponentsConfiguration.applyStateUpdateEarly = defaultApplyStateUpdateEarly;\n ComponentsConfiguration.useResolvedTree = defaultUseResolvedTree;\n }\n}\n","subject":"Add useResolvedTree flag to SplitBuildAndLayoutTestConfiguration"} {"old_contents":"\/*\n * Copyright 2014 Soichiro Kashima\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.github.ksoichiro.android.observablescrollview.samples;\n\nimport com.github.ksoichiro.android.observablescrollview.Scrollable;\n\n\/**\n * Almost same as FillGapBaseActivity,\n * but in this activity, when swiping up, the filled space shrinks\n * and the header bar moves to the top.\n *\/\npublic abstract class FillGap2BaseActivity extends FillGapBaseActivity {\n protected float getHeaderTranslationY(int scrollY) {\n final int headerHeight = mHeaderBar.getHeight();\n int headerTranslationY = 0;\n if (0 <= -scrollY + mFlexibleSpaceImageHeight - headerHeight) {\n headerTranslationY = -scrollY + mFlexibleSpaceImageHeight - headerHeight;\n }\n return headerTranslationY;\n }\n}\n","new_contents":"\/*\n * Copyright 2014 Soichiro Kashima\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.github.ksoichiro.android.observablescrollview.samples;\n\nimport com.github.ksoichiro.android.observablescrollview.ScrollUtils;\nimport com.github.ksoichiro.android.observablescrollview.Scrollable;\n\n\/**\n * Almost same as FillGapBaseActivity,\n * but in this activity, when swiping up, the filled space shrinks\n * and the header bar moves to the top.\n *\/\npublic abstract class FillGap2BaseActivity extends FillGapBaseActivity {\n protected float getHeaderTranslationY(int scrollY) {\n return ScrollUtils.getFloat(-scrollY + mFlexibleSpaceImageHeight - mHeaderBar.getHeight(), 0, Float.MAX_VALUE);\n }\n}\n","subject":"Replace calculation codes to use ScrollUtils in FillGap2 examples."} {"old_contents":"\/**\n * Copyright 2011 The PlayN Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n *\/\npackage playn.shared.json;\n\nimport playn.core.Json;\nimport playn.core.json.JsonImpl;\n\npublic class AbstractJsonTest {\n protected Json json() {\n return new JsonImpl();\n }\n}\n","new_contents":"\/**\n * Copyright 2011 The PlayN Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n *\/\npackage playn.shared.json;\n\nimport org.junit.Ignore;\n\nimport playn.core.Json;\nimport playn.core.json.JsonImpl;\n\n@Ignore\npublic class AbstractJsonTest {\n protected Json json() {\n return new JsonImpl();\n }\n}\n","subject":"Fix test goal for core"} {"old_contents":"package edu.agh.tunev.model;\n\nimport java.awt.geom.Point2D;\n\n\/**\n * Reprezentuje stan przypisany do danego PersonProfile w jakiejś chwili czasu,\n * niezależny od wybranego konkretnego modelu.\n * \n * Obiekty tej klasy używane są głównie do rysowania przebiegu symulacji.\n * \n * Obiekty tej klasy w postaci przekazanej interpolatorowi są w nim pamiętane,\n * więc klasa ta musi być niezmienna (wszystkie jej pola). Gdyby zmienić jedno\n * pole już zapisanego obiektu, to zmieniłby się też w pamięci Interpolatora, a\n * tego nie chcemy.\n * \n *\/\npublic final class PersonState {\n\n\tpublic static enum Movement {\n\t\tSTANDING, SQUATTING, CRAWLING\n\t}\n\n\tpublic final Point2D.Double position;\n\tpublic final double orientation;\n\tpublic final Movement movement;\n\n\tpublic PersonState(Point2D.Double position, double orientation,\n\t\t\tMovement movement) {\n\t\tthis.position = position;\n\t\tthis.orientation = orientation;\n\t\tthis.movement = movement;\n\t}\n\n}","new_contents":"package edu.agh.tunev.model;\n\nimport java.awt.geom.Point2D;\n\n\/**\n * Reprezentuje stan przypisany do danego PersonProfile w jakiejś chwili czasu,\n * niezależny od wybranego konkretnego modelu.\n * \n * Obiekty tej klasy używane są głównie do rysowania przebiegu symulacji.\n * \n * Obiekty tej klasy w postaci przekazanej interpolatorowi są w nim pamiętane,\n * więc klasa ta musi być niezmienna (wszystkie jej pola). Gdyby zmienić jedno\n * pole już zapisanego obiektu, to zmieniłby się też w pamięci Interpolatora, a\n * tego nie chcemy.\n * \n *\/\npublic final class PersonState {\n\n\tpublic static enum Movement {\n\t\tSTANDING, SQUATTING, CRAWLING, DEAD, HIDDEN\n\t}\n\n\tpublic final Point2D.Double position;\n\tpublic final double orientation;\n\tpublic final Movement movement;\n\n\tpublic PersonState(Point2D.Double position, double orientation,\n\t\t\tMovement movement) {\n\t\tthis.position = position;\n\t\tthis.orientation = orientation;\n\t\tthis.movement = movement;\n\t}\n\n}","subject":"Add two additional Movements: DEAD & HIDDEN"} {"old_contents":"import java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileNotFoundException;\nimport java.nio.file.Files;\nimport java.util.*;\nimport machine.learning.ARL;\n\npublic class Programme {\n\n public static void main(String[] args) throws FileNotFoundException {\n\n ArrayList array = new ArrayList();\n Scanner lineReader = new Scanner(new File(\"data\/EURUSD.dat\"));\n\n while(lineReader.hasNext()){\n String line = lineReader.nextLine();\n String[] tmp = line.split(\"\/\")[0].split(\" \");\n array.add(Double.parseDouble(tmp[tmp.length - 1]));\n }\n\n ARL arl = new ARL(13);\n arl.loop(array.subList(200000,260000), false, 1000);\n arl.loop(array.subList(260000,270000), true, 1000);\n\n System.out.println(arl.toString());\n }\n}\n","new_contents":"import java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileNotFoundException;\nimport java.nio.file.Files;\nimport java.util.*;\nimport machine.learning.ARL;\n\npublic class Programme {\n\n public static void main(String[] args) throws FileNotFoundException {\n\n ArrayList array = new ArrayList();\n Scanner lineReader = new Scanner(new File(\"data\/EURUSD.dat\"));\n\n while(lineReader.hasNext()){\n String line = lineReader.nextLine();\n String[] tmp = line.split(\"\/\")[0].split(\" \");\n array.add(Double.parseDouble(tmp[tmp.length - 1]));\n }\n\n ARL arl = new ARL(13);\n \/\/ arl.loop(array.subList(200000,260000), 1000);\n \/\/ arl.loop(array.subList(260000,270000), 1000);\n\n System.out.println(arl.toString());\n }\n}\n","subject":"Change the programme to avoid error, NEED TO BE FIXED"} {"old_contents":"package util;\n\nimport com.google.gson.JsonObject;\nimport okhttp3.RequestBody;\nimport okhttp3.ResponseBody;\nimport retrofit2.Call;\nimport retrofit2.http.*;\n\n\/**\n * Retrofit interfaces wrapping Filestack API.\n *\/\npublic class FilestackService {\n\n public interface Api {\n String URL = \"https:\/\/www.filestackapi.com\/api\/file\/\";\n\n @POST(\"{handle}\")\n Call overwrite(@Path(\"handle\") String handle, @Query(\"policy\") String policy,\n @Query(\"signature\") String signature, @Body RequestBody body);\n\n @DELETE(\"{handle}\")\n Call delete(@Path(\"handle\") String handle, @Query(\"key\") String key,\n @Query(\"policy\") String policy, @Query(\"signature\") String signature);\n }\n\n public interface Cdn {\n String URL = \"https:\/\/cdn.filestackcontent.com\/\";\n\n @GET(\"{handle}\")\n @Streaming\n Call get(@Path(\"handle\") String handle, @Query(\"policy\") String policy,\n @Query(\"signature\") String signature);\n }\n\n public interface Process {\n String URL = \"https:\/\/process.filestackapi.com\/\";\n\n @Streaming\n @GET(\"{tasks}\/{handle}\")\n Call get(@Path(\"tasks\") String tasks, @Path(\"handle\") String handle);\n\n @GET(\"debug\/{tasks}\/{handle}\")\n Call debug(@Path(\"tasks\") String tasks, @Path(\"handle\") String handle);\n }\n}\n","new_contents":"package util;\n\nimport com.google.gson.JsonObject;\nimport okhttp3.RequestBody;\nimport okhttp3.ResponseBody;\nimport retrofit2.Call;\nimport retrofit2.http.*;\n\n\/**\n * Retrofit interfaces wrapping Filestack API.\n *\/\npublic class FilestackService {\n\n public interface Api {\n String URL = \"https:\/\/www.filestackapi.com\/api\/file\/\";\n\n @POST(\"{handle}\")\n Call overwrite(@Path(\"handle\") String handle, @Query(\"policy\") String policy,\n @Query(\"signature\") String signature, @Body RequestBody body);\n\n @DELETE(\"{handle}\")\n Call delete(@Path(\"handle\") String handle, @Query(\"key\") String key,\n @Query(\"policy\") String policy, @Query(\"signature\") String signature);\n }\n\n public interface Cdn {\n String URL = \"https:\/\/cdn.filestackcontent.com\/\";\n\n @GET(\"{handle}\")\n @Streaming\n Call get(@Path(\"handle\") String handle, @Query(\"policy\") String policy,\n @Query(\"signature\") String signature);\n }\n\n public interface Process {\n String URL = \"https:\/\/process.filestackapi.com\/\";\n\n @Streaming\n @GET(\"{tasks}\/{handle}\")\n Call get(@Path(\"tasks\") String tasks, @Path(\"handle\") String handle);\n\n @GET(\"debug\/{tasks}\/{handle}\")\n Call debug(@Path(\"tasks\") String tasks, @Path(\"handle\") String handle);\n\n @Streaming\n @GET(\"{key}\/{tasks}\/{url}\")\n Call getExternal(@Path(\"key\") String key, @Path(\"tasks\") String tasks,\n @Path(\"url\") String url);\n\n @GET(\"{key}\/debug\/{tasks}\/{url}\")\n Call debugExternal(@Path(\"key\") String key, @Path(\"tasks\") String tasks,\n @Path(\"url\") String url);\n }\n}\n","subject":"Add endpoints for external transform and debug"} {"old_contents":"package crazypants.enderio.base.config.recipes.xml;\n\nimport javax.xml.stream.XMLStreamException;\nimport javax.xml.stream.events.StartElement;\n\nimport crazypants.enderio.base.config.recipes.InvalidRecipeConfigException;\nimport crazypants.enderio.base.config.recipes.RecipeConfigElement;\nimport crazypants.enderio.base.config.recipes.StaxFactory;\n\npublic class Data implements RecipeConfigElement {\n\n private float value = Float.NaN;\n\n @Override\n public Object readResolve() throws InvalidRecipeConfigException, XMLStreamException {\n try {\n if (value == Float.NaN) {\n throw new InvalidRecipeConfigException(\"'value' is invalid\");\n }\n } catch (InvalidRecipeConfigException e) {\n throw new InvalidRecipeConfigException(e, \"in \");\n }\n return this;\n }\n\n @Override\n public void enforceValidity() throws InvalidRecipeConfigException {\n }\n\n @Override\n public boolean isValid() {\n return value != Float.NaN;\n }\n\n @Override\n public boolean setAttribute(StaxFactory factory, String name, String value) throws InvalidRecipeConfigException, XMLStreamException {\n if (\"value\".equals(name)) {\n this.value = Float.parseFloat(value);\n return true;\n }\n\n return false;\n }\n\n @Override\n public boolean setElement(StaxFactory factory, String name, StartElement startElement) throws InvalidRecipeConfigException, XMLStreamException {\n return false;\n }\n\n public float getValue() {\n return value;\n }\n\n}\n","new_contents":"package crazypants.enderio.base.config.recipes.xml;\n\nimport javax.xml.stream.XMLStreamException;\nimport javax.xml.stream.events.StartElement;\n\nimport crazypants.enderio.base.config.recipes.InvalidRecipeConfigException;\nimport crazypants.enderio.base.config.recipes.RecipeConfigElement;\nimport crazypants.enderio.base.config.recipes.StaxFactory;\n\npublic class Data implements RecipeConfigElement {\n\n private float value = Float.NaN;\n\n @Override\n public Object readResolve() throws InvalidRecipeConfigException, XMLStreamException {\n try {\n if (Float.isNaN(value)) {\n throw new InvalidRecipeConfigException(\"'value' is invalid\");\n }\n } catch (InvalidRecipeConfigException e) {\n throw new InvalidRecipeConfigException(e, \"in \");\n }\n return this;\n }\n\n @Override\n public void enforceValidity() throws InvalidRecipeConfigException {\n }\n\n @Override\n public boolean isValid() {\n return !Float.isNaN(value);\n }\n\n @Override\n public boolean setAttribute(StaxFactory factory, String name, String value) throws InvalidRecipeConfigException, XMLStreamException {\n if (\"value\".equals(name)) {\n this.value = Float.parseFloat(value);\n return true;\n }\n\n return false;\n }\n\n @Override\n public boolean setElement(StaxFactory factory, String name, StartElement startElement) throws InvalidRecipeConfigException, XMLStreamException {\n return false;\n }\n\n public float getValue() {\n return value;\n }\n\n}\n","subject":"Fix invalid value detection for capKey data not working"} {"old_contents":"package net.earthcomputer.easyeditors.gui.command.syntax;\n\nimport net.earthcomputer.easyeditors.gui.command.slot.CommandSlotFormattedTextField;\nimport net.earthcomputer.easyeditors.gui.command.slot.CommandSlotLabel;\nimport net.earthcomputer.easyeditors.gui.command.slot.CommandSlotTextField;\nimport net.earthcomputer.easyeditors.gui.command.slot.IGuiCommandSlot;\nimport net.earthcomputer.easyeditors.util.Translate;\n\npublic class SyntaxEmote extends CommandSyntax {\n\n\t@Override\n\tpublic IGuiCommandSlot[] setupCommand() {\n\t\treturn new IGuiCommandSlot[] {\n\t\t\t\tCommandSlotLabel.createLabel(Translate.GUI_COMMANDEDITOR_ME_MESSAGE, getContext().canHoldFormatting()\n\t\t\t\t\t\t? new CommandSlotFormattedTextField(500) : new CommandSlotTextField(500, 500)) };\n\t}\n\n}\n","new_contents":"package net.earthcomputer.easyeditors.gui.command.syntax;\n\nimport net.earthcomputer.easyeditors.gui.command.slot.CommandSlotFormattedTextField;\nimport net.earthcomputer.easyeditors.gui.command.slot.CommandSlotLabel;\nimport net.earthcomputer.easyeditors.gui.command.slot.CommandSlotTextField;\nimport net.earthcomputer.easyeditors.gui.command.slot.IGuiCommandSlot;\nimport net.earthcomputer.easyeditors.gui.command.slot.ITextField;\nimport net.earthcomputer.easyeditors.util.Translate;\n\npublic class SyntaxEmote extends CommandSyntax {\n\n\t@Override\n\tpublic IGuiCommandSlot[] setupCommand() {\n\t\tITextField textField;\n\t\tif (getContext().canHoldFormatting()) {\n\t\t\ttextField = new CommandSlotFormattedTextField(500);\n\t\t} else {\n\t\t\ttextField = new CommandSlotTextField(500, 500);\n\t\t}\n\t\ttextField.setMaxStringLength(Short.MAX_VALUE);\n\t\treturn new IGuiCommandSlot[] {\n\t\t\t\tCommandSlotLabel.createLabel(Translate.GUI_COMMANDEDITOR_ME_MESSAGE, (IGuiCommandSlot) textField) };\n\t}\n\n}\n","subject":"Fix max string length in me syntax"} {"old_contents":"\/**\n * Copyright (C) 2009 - 2010 by OpenGamma Inc.\n *\n * Please see distribution for license.\n *\/\npackage com.opengamma.transport.jaxrs;\n\nimport org.fudgemsg.FudgeContext;\n\nimport com.opengamma.util.ArgumentChecker;\n\n\/**\n * Base class for the Fudge JAX-RS objects.\n *\/\n\/* package *\/abstract class FudgeBase {\n\n \/**\n * The Fudge context.\n *\/\n private FudgeContext _fudgeContext;\n\n \/**\n * Creates an instance.\n *\/\n protected FudgeBase() {\n setFudgeContext(FudgeContext.GLOBAL_DEFAULT);\n }\n\n \/\/-------------------------------------------------------------------------\n \/**\n * Gets the Fudge context.\n * @return the context, not null\n *\/\n public FudgeContext getFudgeContext() {\n return _fudgeContext;\n }\n\n \/**\n * Sets the Fudge context.\n * @param fudgeContext the context to use, not null\n *\/\n public void setFudgeContext(final FudgeContext fudgeContext) {\n ArgumentChecker.notNull(fudgeContext, \"fudgeContext\");\n _fudgeContext = fudgeContext;\n }\n\n}\n","new_contents":"\/**\n * Copyright (C) 2009 - 2010 by OpenGamma Inc.\n *\n * Please see distribution for license.\n *\/\npackage com.opengamma.transport.jaxrs;\n\nimport org.fudgemsg.FudgeContext;\n\nimport com.opengamma.util.ArgumentChecker;\nimport com.opengamma.util.fudge.OpenGammaFudgeContext;\n\n\/**\n * Base class for the Fudge JAX-RS objects.\n *\/\n\/* package *\/abstract class FudgeBase {\n\n \/**\n * The Fudge context.\n *\/\n private FudgeContext _fudgeContext;\n\n \/**\n * Creates an instance.\n *\/\n protected FudgeBase() {\n setFudgeContext(OpenGammaFudgeContext.getInstance());\n }\n\n \/\/-------------------------------------------------------------------------\n \/**\n * Gets the Fudge context.\n * @return the context, not null\n *\/\n public FudgeContext getFudgeContext() {\n return _fudgeContext;\n }\n\n \/**\n * Sets the Fudge context.\n * @param fudgeContext the context to use, not null\n *\/\n public void setFudgeContext(final FudgeContext fudgeContext) {\n ArgumentChecker.notNull(fudgeContext, \"fudgeContext\");\n _fudgeContext = fudgeContext;\n }\n\n}\n","subject":"Use the OpenGammaFudgeContext.getInstance() rather than GLOBAL_DEFAULT."} {"old_contents":"package net.zephyrizing.http_server_test;\n\nimport java.io.IOException;\nimport java.net.InetSocketAddress;\nimport java.net.ServerSocket;\nimport java.net.SocketAddress;\n\nimport net.zephyrizing.http_server.HttpServerSocket;\nimport net.zephyrizing.http_server.HttpServerSocketImpl;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\npublic class HttpServerSocketImplTest {\n\n public class TestServerSocket extends ServerSocket {\n public TestServerSocket() throws IOException {\n super();\n }\n\n int port;\n\n @Override\n public void bind(SocketAddress sockAddr) {\n InetSocketAddress iSockAddr = (InetSocketAddress)sockAddr;\n port = iSockAddr.getPort();\n }\n\n public int bindCalledWith() {\n return port;\n }\n }\n\n @Test\n public void testBindSocket() throws Exception {\n TestServerSocket testServerSocket = new TestServerSocket();\n HttpServerSocket socket = new HttpServerSocketImpl(testServerSocket);\n int port = 1000;\n socket.bind(port);\n assertEquals(port, testServerSocket.bindCalledWith());\n }\n}\n","new_contents":"package net.zephyrizing.http_server_test;\n\nimport java.io.IOException;\nimport java.net.InetSocketAddress;\nimport java.net.ServerSocket;\nimport java.net.SocketAddress;\n\nimport net.zephyrizing.http_server.HttpRequest;\nimport net.zephyrizing.http_server.HttpServerSocket;\nimport net.zephyrizing.http_server.HttpServerSocketImpl;\n\nimport org.junit.Ignore;\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\npublic class HttpServerSocketImplTest {\n\n public class TestServerSocket extends ServerSocket {\n public TestServerSocket() throws IOException {\n super();\n }\n\n int port;\n\n @Override\n public void bind(SocketAddress sockAddr) {\n InetSocketAddress iSockAddr = (InetSocketAddress)sockAddr;\n port = iSockAddr.getPort();\n }\n\n public int bindCalledWith() {\n return port;\n }\n }\n\n @Test\n public void testBindSocket() throws Exception {\n TestServerSocket testServerSocket = new TestServerSocket();\n HttpServerSocket socket = new HttpServerSocketImpl(testServerSocket);\n int port = 10000;\n socket.bind(port);\n assertEquals(port, testServerSocket.bindCalledWith());\n }\n\n @Ignore\n @Test\n public void testSocketAccept() throws Exception {\n TestServerSocket testServerSocket = new TestServerSocket();\n HttpServerSocket socket = new HttpServerSocketImpl(testServerSocket);\n socket.bind(10000);\n HttpRequest request = socket.accept();\n assertNotNull(request);\n }\n}\n","subject":"Add a test to motivate the development of the HttpServerSocketImpl"} {"old_contents":"package com.kolinkrewinkel.BitLimitBlockRegression;\n\nimport org.bukkit.Bukkit;\nimport org.bukkit.ChatColor;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Random;\n\n\/**\n * Created with IntelliJ IDEA.\n * User: kolin\n * Date: 7\/14\/13\n * Time: 4:26 PM\n * To change this template use File | Settings | File Templates.\n *\/\n\npublic class BlockGrowthManager {\n private final BitLimitBlockRegression plugin;\n\n public BlockGrowthManager(BitLimitBlockRegression plugin) {\n this.plugin = plugin;\n\n this.startRandomizationEvents();\n }\n\n private void startRandomizationEvents() {\n\n class RepeatingGrowthTask implements Runnable {\n private final BitLimitBlockRegression plugin;\n\n public RepeatingGrowthTask(BitLimitBlockRegression plugin) {\n this.plugin = plugin;\n }\n\n @Override\n public void run() {\n ArrayList conditionsList = (ArrayList) plugin.getConfig().get(\"conditions\");\n if (conditionsList != null) {\n\n } else {\n Bukkit.broadcastMessage(ChatColor.RED + \"No conditions to grow were found.\");\n }\n }\n }\n\n Bukkit.getScheduler().runTaskTimer(this.plugin, new RepeatingGrowthTask(this.plugin), 20L, 0L);\n }\n\n boolean randomWithLikelihood(float likelihood) {\n Random rand = new Random();\n return (rand.nextInt((int)likelihood * 100) == 0);\n }\n}\n","new_contents":"package com.kolinkrewinkel.BitLimitBlockRegression;\n\nimport org.bukkit.Bukkit;\nimport org.bukkit.ChatColor;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Random;\n\n\/**\n * Created with IntelliJ IDEA.\n * User: kolin\n * Date: 7\/14\/13\n * Time: 4:26 PM\n * To change this template use File | Settings | File Templates.\n *\/\n\npublic class BlockGrowthManager {\n private final BitLimitBlockRegression plugin;\n\n public BlockGrowthManager(BitLimitBlockRegression plugin) {\n this.plugin = plugin;\n\n this.startRandomizationEvents();\n }\n\n private void startRandomizationEvents() {\n\n class RepeatingGrowthTask implements Runnable {\n private final BitLimitBlockRegression plugin;\n\n public RepeatingGrowthTask(BitLimitBlockRegression plugin) {\n this.plugin = plugin;\n }\n\n @Override\n public void run() {\n\n Object rawConditions = plugin.getConfig().get(\"conditions\");\n ArrayList conditionsList = null;\n\n if (rawConditions != null) {\n conditionsList = (ArrayList)rawConditions;\n }\n\n\n if (conditionsList != null) {\n\n } else {\n Bukkit.broadcastMessage(ChatColor.RED + \"No conditions to grow were found.\");\n }\n }\n }\n\n Bukkit.getScheduler().runTaskTimer(this.plugin, new RepeatingGrowthTask(this.plugin), 20L, 0L);\n }\n\n boolean randomWithLikelihood(float likelihood) {\n Random rand = new Random();\n return (rand.nextInt((int)likelihood * 100) == 0);\n }\n}\n","subject":"Check before casting a null."} {"old_contents":"package net.wayward_realms.waywardlocks;\n\nimport org.bukkit.ChatColor;\nimport org.bukkit.entity.Player;\nimport org.bukkit.event.EventHandler;\nimport org.bukkit.event.Listener;\nimport org.bukkit.event.inventory.CraftItemEvent;\nimport org.bukkit.inventory.ItemStack;\n\npublic class CraftItemListener implements Listener {\n\n private WaywardLocks plugin;\n\n public CraftItemListener(WaywardLocks plugin) {\n this.plugin = plugin;\n }\n\n @EventHandler\n public void onCraftItem(CraftItemEvent event) {\n for (ItemStack item : event.getInventory().getContents()) {\n if (item != null) {\n if (item.hasItemMeta()) {\n if (item.getItemMeta().getDisplayName().equalsIgnoreCase(\"Key\")) {\n event.setCancelled(true);\n ((Player) event.getWhoClicked()).sendMessage(plugin.getPrefix() + ChatColor.RED + \"You may not use keys as a substitute for iron ingots! ;)\");\n }\n }\n }\n }\n }\n\n}\n","new_contents":"package net.wayward_realms.waywardlocks;\n\nimport org.bukkit.ChatColor;\nimport org.bukkit.entity.Player;\nimport org.bukkit.event.EventHandler;\nimport org.bukkit.event.Listener;\nimport org.bukkit.event.inventory.CraftItemEvent;\nimport org.bukkit.inventory.ItemStack;\n\npublic class CraftItemListener implements Listener {\n\n private WaywardLocks plugin;\n\n public CraftItemListener(WaywardLocks plugin) {\n this.plugin = plugin;\n }\n\n @EventHandler\n public void onCraftItem(CraftItemEvent event) {\n for (ItemStack item : event.getInventory().getContents()) {\n if (item != null) {\n if (item.hasItemMeta()) {\n if (item.getItemMeta().hasDisplayName()) {\n if (item.getItemMeta().getDisplayName().equalsIgnoreCase(\"Key\")) {\n event.setCancelled(true);\n ((Player) event.getWhoClicked()).sendMessage(plugin.getPrefix() + ChatColor.RED + \"You may not use keys as a substitute for iron ingots! ;)\");\n }\n }\n }\n }\n }\n }\n\n}\n","subject":"Fix a bug with crafting keys"} {"old_contents":"\/\/Package manager\nPackageManager pm = getPackageManager();\nString installationSource = pm.getInstallerPackageName(getPackageName());\n \nString source ;\n \n\/\/提供元を判断\nif(installationSource.equals(\"com.android.vending\")){\n source= \"google play\";\t\/\/google\n}else if(installationSource.equals(\"com.amazon.venezia\")){\n source= \"amazon market\";\/\/amazon\n}else{\n source= \"その他のマーケット\";\/\/その他\n}\n Log.d(\"DEBUG\", source + \"からインストールされました。\");","new_contents":"\/**\n* このサンプールコードを使うことによって\n* アンドロイドアプリの提供元を判断することはできます。\n* 1- Google Market(c) からのインストールの場合は Google Wallet(c) APIを実装\n* 2- その他のマーケットの場合はAppmartの課金APIを実装\n*\n* Google Marketの課金APIはこちら\n* http:\/\/developer.android.com\/google\/play\/billing\/billing_integrate.html\n*\n* Appmartの課金APIはこちら\n* https:\/\/github.com\/info-appmart\/inBillingSampleOnePage\n**\/\n\n\/\/Package manager取得\nPackageManager pm = getPackageManager();\nString installationSource = pm.getInstallerPackageName(getPackageName());\n \n\/\/提供元を判断\nif(installationSource.equals(\"com.android.vending\")){\n\tLog.d(\"DEBUG\", \"google Market(c)からインストールされました。\");\n\t\/\/TODO google WalletのAPIを実装\n}else{\n\tLog.d(\"DEBUG\", \"google Market(c)意外のマーケットからインストールされました。\");\n\t\/\/TODO Appmartの課金APIを実装\n}\n\n","subject":"Add comments on main class"} {"old_contents":"package env;\n\nimport types.*;\n\npublic class Env {\n\n public Table tenv;\n public Table venv;\n\n public Env() {\n tenv = new Table();\n put(tenv, \"unit\", UNIT.T);\n put(tenv, \"int\", INT.T);\n put(tenv, \"real\", REAL.T);\n\n venv = new Table();\n put(venv, \"print_int\", new FUNCTION(UNIT.T, INT.T));\n put(venv, \"print_real\", new FUNCTION(UNIT.T, REAL.T));\n put(venv, \"round\", new FUNCTION(INT.T, REAL.T));\n put(venv, \"ceil\", new FUNCTION(INT.T, REAL.T));\n put(venv, \"floor\", new FUNCTION(INT.T, REAL.T));\n put(venv, \"real\", new FUNCTION(REAL.T, INT.T));\n }\n\n @Override\n public String toString() {\n return \"Env{\" +\n \"tenv=\" + tenv +\n \", venv=\" + venv +\n '}';\n }\n\n private static void put(Table table, String name, E value) {\n table.put(name.intern(), value);\n }\n\n}\n","new_contents":"package env;\n\nimport types.*;\n\npublic class Env {\n\n public Table tenv;\n public Table venv;\n\n public Env() {\n tenv = new Table();\n put(tenv, \"unit\", UNIT.T);\n put(tenv, \"int\", INT.T);\n put(tenv, \"real\", REAL.T);\n\n venv = new Table();\n put(venv, \"print_int\", new FUNCTION(UNIT.T, INT.T));\n put(venv, \"print_real\", new FUNCTION(UNIT.T, REAL.T));\n put(venv, \"print_unit\", new FUNCTION(UNIT.T, UNIT.T));\n put(venv, \"round\", new FUNCTION(INT.T, REAL.T));\n put(venv, \"ceil\", new FUNCTION(INT.T, REAL.T));\n put(venv, \"floor\", new FUNCTION(INT.T, REAL.T));\n put(venv, \"real\", new FUNCTION(REAL.T, INT.T));\n }\n\n @Override\n public String toString() {\n return \"Env{\" +\n \"tenv=\" + tenv +\n \", venv=\" + venv +\n '}';\n }\n\n private static void put(Table table, String name, E value) {\n table.put(name.intern(), value);\n }\n\n}\n","subject":"Add 'print_unit' to the default environment"} {"old_contents":"package com.thoughtworks.xstream.core.util;\n\npublic final class ClassStack {\n\n private Class[] stack;\n private int pointer;\n\n public ClassStack(int initialCapacity) {\n stack = new Class[initialCapacity];\n }\n\n public void push(Class value) {\n if (pointer + 1 >= stack.length) {\n resizeStack(stack.length * 2);\n }\n stack[pointer++] = value;\n }\n\n public void popSilently() {\n pointer--;\n }\n\n public Class pop() {\n return stack[--pointer];\n }\n\n public Class peek() {\n return pointer == 0 ? null : stack[pointer - 1];\n }\n\n public int size() {\n return pointer;\n }\n\n public Class get(int i) {\n return stack[i];\n }\n\n private void resizeStack(int newCapacity) {\n Class[] newStack = new Class[newCapacity];\n System.arraycopy(stack, 0, newStack, 0, Math.min(stack.length, newCapacity));\n stack = newStack;\n }\n}\n","new_contents":"package com.thoughtworks.xstream.core.util;\n\npublic final class ClassStack {\n\n private Class[] stack;\n private int pointer;\n\n public ClassStack(int initialCapacity) {\n stack = new Class[initialCapacity];\n }\n\n public void push(Class value) {\n if (pointer + 1 >= stack.length) {\n resizeStack(stack.length * 2);\n }\n stack[pointer++] = value;\n }\n\n public void popSilently() {\n stack[--pointer] = null;\n }\n\n public Class pop() {\n final Class result = stack[--pointer];\n stack[pointer] = null;\n return result;\n }\n\n public Class peek() {\n return pointer == 0 ? null : stack[pointer - 1];\n }\n\n public int size() {\n return pointer;\n }\n\n public Class get(int i) {\n return stack[i];\n }\n\n private void resizeStack(int newCapacity) {\n Class[] newStack = new Class[newCapacity];\n System.arraycopy(stack, 0, newStack, 0, Math.min(stack.length, newCapacity));\n stack = newStack;\n }\n}\n","subject":"Drop references from popped classes."} {"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\npackage org.jsecurity.util;\n\n\/**\n * Interface implemented by components that can be named, such as via configuration, and wish to have that name\n * set once it has been configured.\n *\n * @author Les Hazlewood\n * @since 0.9\n *\/\npublic interface Nameable {\n\n \/**\n * Sets the (preferably application unique) name for this component.\n * @param name the preferably application unique name for this component.\n *\/\n void setName(String name);\n}\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\npackage org.jsecurity.util;\n\nBREAK BUILD\n\n\/**\n * Interface implemented by components that can be named, such as via configuration, and wish to have that name\n * set once it has been configured.\n *\n * @author Les Hazlewood\n * @since 0.9\n *\/\npublic interface Nameable {\n\n \/**\n * Sets the (preferably application unique) name for this component.\n * @param name the preferably application unique name for this component.\n *\/\n void setName(String name);\n}\n","subject":"Break the build to test Hudson"} {"old_contents":"package com.bert.pixels;\n\nimport com.bert.pixels.models.Chamber;\nimport com.bert.pixels.view.TextVisualization;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n\/**\n * Entry point to solve the pixel exercise\n *\/\npublic class Animation {\n\n private final static int MAX_SIZE = 10;\n\n public static void main(String[] args) {\n final int speed = Integer.parseInt(args[1]);\n TextVisualization visualization = new TextVisualization(MAX_SIZE);\n final Chamber chamber = visualization.from(args[0]);\n \/\/ We could try to get the max nb of iteration by using the size of the chamber and the speed\n \/\/ and only allocate that many entries in the list #prematureoptimization\n List iterations = new ArrayList<>();\n while (!chamber.isEmpty()) {\n iterations.add(visualization.to(chamber.movePixels(speed)));\n }\n System.out.println(String.join(\"\\n\", iterations));\n }\n}\n","new_contents":"package com.bert.pixels;\n\nimport com.bert.pixels.models.Chamber;\nimport com.bert.pixels.view.TextVisualization;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n\/**\n * Entry point to solve the pixel exercise\n *\/\npublic class Animation {\n\n private final static int MAX_SIZE = 10;\n\n public static void main(String[] args) {\n final int speed = Integer.parseInt(args[1]);\n TextVisualization visualization = new TextVisualization(MAX_SIZE);\n final Chamber chamber = visualization.from(args[0]);\n \/\/ We could try to get the max nb of iteration by using the size of the chamber and the speed\n \/\/ and only allocate that many entries in the list #prematureoptimization\n List iterations = new ArrayList<>();\n iterations.add(visualization.to(chamber));\n while (!chamber.isEmpty()) {\n iterations.add(visualization.to(chamber.movePixels(speed)));\n }\n System.out.println(String.join(\"\\n\", iterations));\n }\n}\n","subject":"Add original state to output"} {"old_contents":"package models;\n\nimport java.util.Date;\n\nimport javax.persistence.Entity;\nimport javax.persistence.EnumType;\nimport javax.persistence.Enumerated;\nimport javax.persistence.JoinColumn;\nimport javax.persistence.OneToOne;\n\nimport models.Server.Status;\nimport play.db.jpa.Model;\n\n@Entity\npublic class EventLog extends Model {\n\n @OneToOne\n @JoinColumn(name = \"server_id\")\n public Server server;\n @Enumerated(EnumType.ORDINAL)\n public Status status;\n public String message;\n public Date created;\n\n}\n","new_contents":"package models;\n\nimport java.util.Date;\n\nimport javax.persistence.Entity;\nimport javax.persistence.EnumType;\nimport javax.persistence.Enumerated;\n\nimport play.db.jpa.Model;\n\n@Entity\npublic class EventLog extends Model {\n\n public static enum Type {\n Server, Probe;\n }\n\n \/\/ Event creates from server status or probe status\n @Enumerated(EnumType.ORDINAL)\n public Type type;\n\n \/\/ Event instance, server id or probe id\n public Long instance;\n\n \/\/ Event status, e.g. 0 for server means fail and 1 for server means ok.\n public Integer status;\n\n \/\/ Event message\n public String message;\n public Date created;\n\n}\n","subject":"Change event model to support probe status."} {"old_contents":"package org.mapfish.print.test.util;\n\nimport org.mapfish.print.attribute.Attribute;\nimport org.mapfish.print.attribute.NorthArrowAttribute;\nimport org.mapfish.print.attribute.ScalebarAttribute;\nimport org.mapfish.print.attribute.map.GenericMapAttribute;\n\n\/**\n * Support for testing attributes. This is in main jar because it might be needed across module boundaries\n * and that can be difficult if it is in testing jar.\n *

      \n * CHECKSTYLE:OFF\n *\/\npublic class AttributeTesting {\n \/**\n * A few attributes will throw exceptions if not initialized this method can be called when an attribute\n * needs testing but the test is generic and does not necessarily want or need to know the specific type\n * of attribute and its properties.\n *\/\n public static void configureAttributeForTesting(Attribute att) {\n if (att instanceof GenericMapAttribute) {\n GenericMapAttribute genericMapAttribute = (GenericMapAttribute) att;\n genericMapAttribute.setWidth(500);\n genericMapAttribute.setHeight(500);\n genericMapAttribute.setMaxDpi(400.0);\n } else if (att instanceof ScalebarAttribute) {\n ScalebarAttribute scalebarAttribute = (ScalebarAttribute) att;\n scalebarAttribute.setWidth(300);\n scalebarAttribute.setHeight(120);\n } else if (att instanceof NorthArrowAttribute) {\n NorthArrowAttribute northArrowAttribute = (NorthArrowAttribute) att;\n northArrowAttribute.setSize(50);\n }\n }\n}\n","new_contents":"package org.mapfish.print.test.util;\n\nimport org.mapfish.print.attribute.Attribute;\nimport org.mapfish.print.attribute.NorthArrowAttribute;\nimport org.mapfish.print.attribute.ScalebarAttribute;\nimport org.mapfish.print.attribute.map.GenericMapAttribute;\n\n\/**\n * Support for testing attributes. This is in main jar because it might be needed across module boundaries\n * and that can be difficult if it is in testing jar.\n *

      \n * CHECKSTYLE:OFF\n *\/\npublic class AttributeTesting {\n\n private AttributeTesting() {\n throw new IllegalStateException(\"Utility class\");\n }\n \/**\n * A few attributes will throw exceptions if not initialized this method can be called when an attribute\n * needs testing but the test is generic and does not necessarily want or need to know the specific type\n * of attribute and its properties.\n *\/\n public static void configureAttributeForTesting(Attribute att) {\n if (att instanceof GenericMapAttribute) {\n GenericMapAttribute genericMapAttribute = (GenericMapAttribute) att;\n genericMapAttribute.setWidth(500);\n genericMapAttribute.setHeight(500);\n genericMapAttribute.setMaxDpi(400.0);\n } else if (att instanceof ScalebarAttribute) {\n ScalebarAttribute scalebarAttribute = (ScalebarAttribute) att;\n scalebarAttribute.setWidth(300);\n scalebarAttribute.setHeight(120);\n } else if (att instanceof NorthArrowAttribute) {\n NorthArrowAttribute northArrowAttribute = (NorthArrowAttribute) att;\n northArrowAttribute.setSize(50);\n }\n }\n}\n","subject":"Add private constructor for utility class."} {"old_contents":"package org.bouncycastle.crypto.tls;\n\nimport java.io.IOException;\nimport java.io.OutputStream;\n\n\/**\n * An OutputStream for an TLS connection.\n *\/\npublic class TlsOuputStream extends OutputStream\n{\n\n private TlsProtocolHandler handler;\n\n protected TlsOuputStream(TlsProtocolHandler handler)\n {\n this.handler = handler;\n }\n\n public void write(byte buf[], int offset, int len) throws IOException\n {\n this.handler.writeData(buf, offset, len);\n }\n\n public void write(int arg0) throws IOException\n {\n byte[] buf = new byte[1];\n buf[0] = (byte)arg0;\n this.write(buf, 0, 1);\n }\n\n\n public void close() throws IOException\n {\n handler.close();\n }\n\n public void flush() throws IOException\n {\n handler.flush();\n }\n}\n","new_contents":"package org.bouncycastle.crypto.tls;\n\nimport java.io.IOException;\nimport java.io.OutputStream;\n\n\/**\n * An OutputStream for an TLS connection.\n *\/\npublic class TlsOuputStream extends OutputStream\n{\n\n private TlsProtocolHandler handler;\n\n protected TlsOuputStream(TlsProtocolHandler handler)\n {\n this.handler = handler;\n }\n\n public void write(byte buf[], int offset, int len) throws IOException\n {\n this.handler.writeData(buf, offset, len);\n }\n\n public void write(int arg0) throws IOException\n {\n byte[] buf = new byte[1];\n buf[0] = (byte)arg0;\n this.write(buf, 0, 1);\n }\n\n \/** @deprecated Use 'close' instead *\/\n public void cose() throws IOException\n {\n handler.close();\n }\n\n public void close() throws IOException\n {\n handler.close();\n }\n\n public void flush() throws IOException\n {\n handler.flush();\n }\n}\n","subject":"Add cose() back as a deprecated method for backward compatibility"} {"old_contents":"package com.ksu.addressbook.tests;\n\nimport com.ksu.addressbook.model.GroupData;\nimport org.testng.Assert;\nimport org.testng.annotations.Test;\n\nimport java.util.HashSet;\nimport java.util.List;\n\npublic class GroupCreationTests extends TestBase{\n\n @Test\n public void testGroupCreation() {\n\n app.getNavigationHelper().goToGroupPage();\n List before = app.getGroupHelper().getGroupList();\n GroupData group = new GroupData(\"Group1\", \"The first Group\", \"My first group\");\n app.getGroupHelper().createGroup(group);\n List after = app.getGroupHelper().getGroupList();\n Assert.assertEquals(after.size(), before.size() + 1);\n\n int max = 0;\n for (GroupData g: after){\n max = g.getId() > max ? g.getId() : max;\n }\n group.setId(max);\n before.add(group);\n Assert.assertEquals(new HashSet(before), new HashSet(after));\n }\n\n}\n","new_contents":"package com.ksu.addressbook.tests;\n\nimport com.ksu.addressbook.model.GroupData;\nimport org.testng.Assert;\nimport org.testng.annotations.Test;\n\nimport java.util.Comparator;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.zip.Inflater;\n\npublic class GroupCreationTests extends TestBase{\n\n @Test\n public void testGroupCreation() {\n\n app.getNavigationHelper().goToGroupPage();\n List before = app.getGroupHelper().getGroupList();\n GroupData group = new GroupData(\"Group1\", \"The first Group\", \"My first group\");\n app.getGroupHelper().createGroup(group);\n List after = app.getGroupHelper().getGroupList();\n Assert.assertEquals(after.size(), before.size() + 1);\n\n\/\/ Way 1:\n\/\/ int max = 0;\n\/\/ for (GroupData g: after){\n\/\/ max = g.getId() > max ? g.getId() : max;\n\/\/ }\n\n\/\/ Way 2:\n\/\/ Comparator byId = new Comparator() {\n\/\/ @Override\n\/\/ public int compare(GroupData o1, GroupData o2) {\n\/\/ return Integer.compare(o1.getId(), o2.getId());\n\/\/ }\n\/\/ } ;\n\/\/ int max = after.stream().max(byId).get().getId();\n\n\/\/ Way 3:\n\/\/ Comparator byId = (o1, o2) -> Integer.compare(o1.getId(), o2.getId());\n\n group.setId(after.stream().max((o1, o2) -> Integer.compare(o1.getId(), o2.getId())).get().getId());\n before.add(group);\n Assert.assertEquals(new HashSet(before), new HashSet(after));\n }\n\n}\n","subject":"Change the way of getting max groupId (loop changed to stream max with lambda)"} {"old_contents":"package net.deltaplay.tweener;\n\npublic class TweenManager extends CompositeTween {\n\n @Override\n public void update(float delta) {\n for (int i = 0; i < tweens.size; i++) {\n tweens.get(i).update(delta);\n }\n }\n\n @Override\n public TweenManager getThis() {\n return this;\n }\n}\n","new_contents":"package net.deltaplay.tweener;\n\nimport net.deltaplay.tweener.Tweener.Tween;\n\npublic class TweenManager extends CompositeTween {\n\n @Override\n public void update(float delta) {\n for (int i = 0; i < tweens.size; i++) {\n tweens.get(i).update(delta);\n }\n }\n\n @Override\n public TweenManager getThis() {\n return this;\n }\n\n public void remove(Tween tween) {\n tweens.removeValue(tween, false);\n }\n}\n","subject":"Add remove method to GameManager"} {"old_contents":"\/\/ Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\npackage com.yahoo.config.model.api;\n\nimport com.yahoo.config.application.api.ValidationId;\n\n\/**\n * Represents an action to re-index a document type in order to handle a config change.\n *\n * @author bjorncs\n *\/\npublic interface ConfigChangeReindexAction extends ConfigChangeAction {\n\n @Override default Type getType() { return Type.REINDEX; }\n\n \/** @return name identifying this kind of change, used to identify names which should be allowed *\/\n default String name() { return validationId().orElseThrow().value(); }\n\n \/** @return name of the document type that must be re-indexed *\/\n String getDocumentType();\n}\n","new_contents":"\/\/ Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\npackage com.yahoo.config.model.api;\n\nimport com.yahoo.config.application.api.ValidationId;\n\n\/**\n * Represents an action to re-index a document type in order to handle a config change.\n *\n * @author bjorncs\n *\/\npublic interface ConfigChangeReindexAction extends ConfigChangeAction {\n\n @Override default Type getType() { return Type.REINDEX; }\n\n \/** @return name identifying this kind of change, used to identify names which should be allowed *\/\n default String name() { return validationId().map(ValidationId::value).orElse(\"reindexing\"); }\n\n \/** @return name of the document type that must be re-indexed *\/\n String getDocumentType();\n}\n","subject":"Use a default value of \"reindexing\" as \"name\" for reindex actions"} {"old_contents":"package com.routeme.dto;\n\nimport org.hibernate.validator.constraints.NotBlank;\n\npublic class SearchRequestDTO {\n @NotBlank\n private String startPoint;\n\n @NotBlank\n private String endPoint;\n\n public String getEndPoint() {\n return endPoint;\n }\n\n public String getStartPoint() {\n return startPoint;\n }\n\n}\n","new_contents":"package com.routeme.dto;\n\nimport javax.validation.constraints.Pattern;\n\nimport org.hibernate.validator.constraints.NotBlank;\n\npublic class SearchRequestDTO {\n @Pattern(regexp = \"^[^0-9]*$\", message = \"Numbers are not allowed\")\n @NotBlank\n private String startPoint;\n\n @Pattern(regexp = \"^[^0-9]*$\", message = \"Numbers are not allowed\")\n @NotBlank\n private String endPoint;\n\n public String getEndPoint() {\n return endPoint;\n }\n\n public String getStartPoint() {\n return startPoint;\n }\n\n}\n","subject":"Implement search input no number validation"} {"old_contents":"package wumpus;\n\nimport java.util.Iterator;\nimport java.util.NoSuchElementException;\n\nimport wumpus.Environment.Result;\n\n\/**\n * The iteration of plays that the player can take until reaches its end.\n *\/\npublic class Runner implements Iterable, Iterator {\n private final World world;\n private int iterations = 0;\n private int maxIterations;\n\n \/**\n * The runner constructor.\n * @param world The world instance.\n *\/\n public Runner(World world) {\n this.world = world;\n this.maxIterations = world.getMaxSteps();\n }\n\n \/**\n * Returns the iterator that can be user in a loop.\n * @return Itself\n *\/\n public Iterator iterator() {\n return this;\n }\n\n \/**\n * Check if the game has ended.\n * @return\n *\/\n public boolean hasNext() {\n Player player = world.getPlayer();\n return iterations < maxIterations &&\n player.isAlive() && world.getResult() != Result.WIN;\n }\n\n \/**\n * Get player instance to calculate the next iteration.\n * @return The current player instance\n *\/\n public Player next() {\n if (!hasNext()) throw new NoSuchElementException();\n iterations++;\n return world.getPlayer();\n }\n\n \/**\n * Operation not supported, throws an error.\n *\/\n public void remove() {\n throw new UnsupportedOperationException();\n }\n}\n","new_contents":"package wumpus;\n\nimport java.util.Iterator;\nimport java.util.NoSuchElementException;\n\nimport wumpus.Environment.Result;\nimport wumpus.Environment.Action;\n\n\/**\n * The iteration of plays that the player can take until reaches its end.\n *\/\npublic class Runner implements Iterable, Iterator {\n private final World world;\n private int iterations = 0;\n private int maxIterations;\n\n \/**\n * The runner constructor.\n * @param world The world instance.\n *\/\n public Runner(World world) {\n this.world = world;\n this.maxIterations = world.getMaxSteps();\n }\n\n \/**\n * Returns the iterator that can be user in a loop.\n * @return Itself\n *\/\n public Iterator iterator() {\n return this;\n }\n\n \/**\n * Check if the game has ended.\n * @return\n *\/\n public boolean hasNext() {\n Player player = world.getPlayer();\n return iterations < maxIterations && world.getResult() != Result.WIN &&\n player.isAlive() && player.getLastAction() != Action.END;\n }\n\n \/**\n * Get player instance to calculate the next iteration.\n * @return The current player instance\n *\/\n public Player next() {\n if (!hasNext()) throw new NoSuchElementException();\n iterations++;\n return world.getPlayer();\n }\n\n \/**\n * Operation not supported, throws an error.\n *\/\n public void remove() {\n throw new UnsupportedOperationException();\n }\n}\n","subject":"Make runner stop when player last action is to end"} {"old_contents":"package camelinaction;\n\nimport org.apache.camel.Exchange;\nimport org.apache.camel.Processor;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n\/**\n * Processor to stop a route by its name\n *\/\npublic class StopRouteProcessor implements Processor {\n\n private final static Logger LOG = LoggerFactory.getLogger(StopRouteProcessor.class);\n\n private final String name;\n\n \/**\n * @param name route to stop\n *\/\n public StopRouteProcessor(String name) {\n this.name = name;\n }\n\n public void process(Exchange exchange) throws Exception {\n \/\/ force stopping this route while we are routing an Exchange\n \/\/ requires two steps:\n \/\/ 1) unregister from the inflight registry\n \/\/ 2) stop the route\n LOG.info(\"Stopping route: \" + name);\n exchange.getContext().getInflightRepository().remove(exchange, \"manual\");\n exchange.getContext().stopRoute(name);\n }\n}\n","new_contents":"package camelinaction;\n\nimport org.apache.camel.Exchange;\nimport org.apache.camel.Processor;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n\/**\n * Processor to stop a route by its name\n *\/\npublic class StopRouteProcessor implements Processor {\n\n private final static Logger LOG = LoggerFactory.getLogger(StopRouteProcessor.class);\n\n private final String name;\n\n \/**\n * @param name route to stop\n *\/\n public StopRouteProcessor(String name) {\n this.name = name;\n }\n\n public void process(Exchange exchange) throws Exception {\n \/\/ force stopping this route while we are routing an Exchange\n \/\/ requires two steps:\n \/\/ 1) unregister from the inflight registry\n \/\/ 2) stop the route\n LOG.info(\"Stopping route: \" + name);\n exchange.getContext().getInflightRepository().remove(exchange, name);\n exchange.getContext().stopRoute(name);\n }\n}\n","subject":"Use parameter instead of hardcoded \"manual\""} {"old_contents":"package net.dimensions.solar.block;\n\npublic interface Block\n{\n String getUnlocalizedName();\n\n float getHardness();\n\n int getLightValue();\n\n boolean isReplaceable();\n\n boolean isBurning();\n\n int getFlammability();\n\n boolean isFlammable();\n\n int getFireSpreadSpeed();\n\n boolean hasTileEntity();\n}\n","new_contents":"package net.dimensions.solar.block;\n\npublic interface Block{\n\n public Material getType();\n\n public void setType(Material m);\n\n public String getUnlocalizedName(); \/\/I don't think we need this because it's already in the Material\n\n public float getHardness();\n\n public int getLightValue();\n\n public boolean isReplaceable();\n\n public boolean isBurning();\n\n public int getFlameTick();\n\n public boolean isFlammable();\n\n public int getFireSpreadSpeed();\n\n public boolean isTileEntity();\n}\n","subject":"Add Material & change methods"} {"old_contents":"package io.warp10;\n\npublic class Revision {\n public static final String REVISION = \"1.0.1-203-ga9b2a06\";\n}\n","new_contents":"package io.warp10;\n\npublic class Revision {\n public static final String REVISION = \"1.0.0\";\n}\n","subject":"Revert it (never commit revision)"} {"old_contents":"package io.outreach;\n\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.security.KeyStore;\nimport java.util.Arrays;\n\npublic class TrustStore {\n\n\tpublic static KeyStore get() {\n\t\ttry {\n\t\t\tKeyStore keyStore = KeyStore.getInstance(\"JKS\");\n\t\t\tchar[] password = \"outreach\".toCharArray();\n\t\t\tkeyStore.load(stream(), password);\n\t\t\tArrays.fill(password, '\\0');\n\t\t\treturn keyStore;\n\t\t} catch (Exception ignore) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate static InputStream stream() throws IOException {\n\t\treturn new FileInputStream(\"\/Users\/dc\/Projects\/outreach-platform-sdk\/src\/test\/resources\/outreach.truststore\");\n\t}\n\n}\n","new_contents":"package io.outreach;\n\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.security.KeyStore;\nimport java.util.Arrays;\n\npublic class TrustStore {\n\n\tpublic static KeyStore get() {\n\t\ttry {\n\t\t\tKeyStore keyStore = KeyStore.getInstance(\"JKS\");\n\t\t\tchar[] password = \"outreach\".toCharArray();\n\t\t\tkeyStore.load(stream(), password);\n\t\t\tArrays.fill(password, '\\0');\n\t\t\treturn keyStore;\n\t\t} catch (Exception ignore) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate static InputStream stream() throws IOException {\n\t\treturn new FileInputStream(\"src\/test\/resources\/outreach.truststore\");\n\t}\n\n}\n","subject":"Make path to trust cert relative."} {"old_contents":"package com.ezardlabs.lostsector.objects.projectiles;\n\nimport com.ezardlabs.dethsquare.Collider;\nimport com.ezardlabs.dethsquare.GameObject;\nimport com.ezardlabs.dethsquare.Script;\nimport com.ezardlabs.lostsector.Game.DamageType;\nimport com.ezardlabs.lostsector.objects.Entity;\n\npublic class Laser extends Script {\n\n\tprivate final int damage;\n\n\tpublic Laser(int damage) {\n\t\tthis.damage = damage;\n\t}\n\n\t@Override\n\tpublic void start() {\n\t\tgameObject.setTag(\"projectile\");\n\t}\n\n\t@Override\n\tpublic void update() {\n\t\ttransform.translate(gameObject.transform.scale.x * 15, 0);\n\t\tif (transform.position.x <= 0) GameObject.destroy(gameObject);\n\t}\n\t\n\t@Override\n\tpublic void onTriggerEnter(Collider other) {\n\t\tif (other.gameObject.getTag() != null) {\n\t\t\tif (other.gameObject.getTag().equals(\"player\")) {\n\t\t\t\t\/\/noinspection ConstantConditions\n\t\t\t\tother.gameObject.getComponentOfType(Entity.class)\n\t\t\t\t\t\t\t\t.applyDamage(damage, DamageType.NORMAL,\n\t\t\t\t\t\t\t\t\t\ttransform.position);\n\t\t\t\tgameObject.removeComponent(Collider.class);\n\t\t\t\tGameObject.destroy(gameObject);\n\t\t\t} else if (other.gameObject.getTag().equals(\"solid\")) {\n\t\t\t\tgameObject.removeComponent(Collider.class);\n\t\t\t\tGameObject.destroy(gameObject);\n\t\t\t}\n\t\t}\n\t}\n}\n","new_contents":"package com.ezardlabs.lostsector.objects.projectiles;\n\nimport com.ezardlabs.dethsquare.Collider;\nimport com.ezardlabs.dethsquare.GameObject;\nimport com.ezardlabs.dethsquare.Script;\nimport com.ezardlabs.lostsector.Game.DamageType;\nimport com.ezardlabs.lostsector.objects.Entity;\n\npublic class Laser extends Script {\n\n\tprivate final int damage;\n\n\tpublic Laser(int damage) {\n\t\tthis.damage = damage;\n\t}\n\n\t@Override\n\tpublic void start() {\n\t\tgameObject.setTag(\"projectile\");\n\t}\n\n\t@Override\n\tpublic void update() {\n\t\ttransform.translate(gameObject.transform.scale.x * 15, 0);\n\t\tif (transform.position.x <= 0) GameObject.destroy(gameObject);\n\t}\n\n\t@Override\n\tpublic void onTriggerEnter(Collider other) {\n\t\tif (other.gameObject.getTag() != null) {\n\t\t\tif (\"player\".equals(other.gameObject.getTag()) || \"cryopod\".equals(other.gameObject.getTag())) {\n\t\t\t\t\/\/noinspection ConstantConditions\n\t\t\t\tother.gameObject.getComponentOfType(Entity.class)\n\t\t\t\t\t\t\t\t.applyDamage(damage, DamageType.NORMAL, transform.position);\n\t\t\t\tgameObject.removeComponent(Collider.class);\n\t\t\t\tGameObject.destroy(gameObject);\n\t\t\t} else if (other.gameObject.getTag().equals(\"solid\")) {\n\t\t\t\tgameObject.removeComponent(Collider.class);\n\t\t\t\tGameObject.destroy(gameObject);\n\t\t\t}\n\t\t}\n\t}\n}\n","subject":"Allow lasers to damage cryopods"} {"old_contents":"package com.mapswithme.maps.base;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.support.annotation.CallSuper;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\n\nimport com.mapswithme.maps.auth.Authorizer;\nimport com.mapswithme.maps.auth.TargetFragmentCallback;\n\npublic abstract class BaseAuthFragment extends BaseAsyncOperationFragment\n implements Authorizer.Callback, TargetFragmentCallback\n{\n @NonNull\n private final Authorizer mAuthorizer = new Authorizer(this);\n\n protected void authorize()\n {\n mAuthorizer.authorize();\n }\n\n @Override\n @CallSuper\n public void onAttach(Context context)\n {\n super.onAttach(context);\n mAuthorizer.attach(this);\n }\n\n @Override\n @CallSuper\n public void onDestroyView()\n {\n super.onDestroyView();\n mAuthorizer.detach();\n }\n\n @Override\n public void onTargetFragmentResult(int resultCode, @Nullable Intent data)\n {\n mAuthorizer.onTargetFragmentResult(resultCode, data);\n }\n\n @Override\n public boolean isTargetAdded()\n {\n return isAdded();\n }\n\n protected boolean isAuthorized()\n {\n return mAuthorizer.isAuthorized();\n }\n}\n","new_contents":"package com.mapswithme.maps.base;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.support.annotation.CallSuper;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\n\nimport com.mapswithme.maps.auth.Authorizer;\nimport com.mapswithme.maps.auth.TargetFragmentCallback;\n\npublic abstract class BaseAuthFragment extends BaseAsyncOperationFragment\n implements Authorizer.Callback, TargetFragmentCallback\n{\n @NonNull\n private final Authorizer mAuthorizer = new Authorizer(this);\n\n protected void authorize()\n {\n mAuthorizer.authorize();\n }\n\n @Override\n @CallSuper\n public void onStart()\n {\n super.onStart();\n mAuthorizer.attach(this);\n }\n\n @Override\n @CallSuper\n public void onStop()\n {\n super.onStop();\n mAuthorizer.detach();\n }\n\n @Override\n public void onTargetFragmentResult(int resultCode, @Nullable Intent data)\n {\n mAuthorizer.onTargetFragmentResult(resultCode, data);\n }\n\n @Override\n public boolean isTargetAdded()\n {\n return isAdded();\n }\n\n protected boolean isAuthorized()\n {\n return mAuthorizer.isAuthorized();\n }\n}\n","subject":"Revert changes - added methods like legacy auth fragment"} {"old_contents":"\/* *\\\n** SICU Stress Measurement System **\n** Project P04 | C380 Team A **\n** EBME 380: Biomedical Engineering Design Experience **\n** Case Western Reserve University **\n** 2016 Fall Semester **\n\\* *\/\n\npackage edu.cwru.sicu_sms;\n\nimport javafx.application.Application;\nimport javafx.fxml.FXMLLoader;\nimport javafx.scene.Parent;\nimport javafx.scene.Scene;\nimport javafx.scene.image.Image;\nimport javafx.stage.Stage;\n\n\/**\n * The main stage of the front-end program for interfacing with the electronic system.\n *\n * @since September 27, 2016\n * @author Ted Frohlich \n * @author Abby Walker \n *\/\npublic class Main extends Application {\n \n @Override\n public void start(Stage primaryStage) throws Exception {\n Parent root = FXMLLoader.load(\n getClass().getResource(\"scene\/sicu_sms.fxml\")\n );\n primaryStage.getIcons().add(new Image(\n \"http:\/\/s3.amazonaws.com\/libapps\/customers\/558\/images\/CWRU_Logo.jpg\"));\n primaryStage.setTitle(\"SICU Stress Measurement System\");\n primaryStage.setScene(new Scene(root));\n primaryStage.setMaximized(true);\n primaryStage.show();\n }\n \n public static void main(String[] args) {\n launch(args);\n }\n \n}\n","new_contents":"\/* *\\\n** SICU Stress Measurement System **\n** Project P04 | C380 Team A **\n** EBME 380: Biomedical Engineering Design Experience **\n** Case Western Reserve University **\n** 2016 Fall Semester **\n\\* *\/\n\npackage edu.cwru.sicu_sms;\n\nimport javafx.application.Application;\nimport javafx.fxml.FXMLLoader;\nimport javafx.scene.Scene;\nimport javafx.scene.image.Image;\nimport javafx.stage.Stage;\n\n\/**\n * The main stage of the front-end program for interfacing with the electronic system.\n *\n * @since September 27, 2016\n * @author Ted Frohlich \n * @author Abby Walker \n *\/\npublic class Main extends Application {\n \n @Override\n public void start(Stage primaryStage) throws Exception {\n primaryStage.setScene(new Scene(\n FXMLLoader.load(getClass().getResource(\"scene\/sicu_sms.fxml\"))));\n \n primaryStage.setTitle(\"SICU Stress Measurement System\");\n primaryStage.getIcons()\n .add(new Image(\"http:\/\/s3.amazonaws.com\/libapps\/customers\/558\/images\/CWRU_Logo.jpg\"));\n \n primaryStage.setMaximized(true);\n primaryStage.show();\n }\n \n public static void main(String[] args) {\n launch(args);\n }\n \n}\n","subject":"Revise flow of 'start' method"} {"old_contents":"package org.ethereum;\n\nimport org.ethereum.cli.CLIInterface;\nimport org.ethereum.config.SystemProperties;\nimport org.ethereum.facade.Ethereum;\nimport org.ethereum.facade.EthereumFactory;\n\nimport java.io.IOException;\nimport java.net.URISyntaxException;\n\n\/**\n * @author Roman Mandeleil\n * @since 14.11.2014\n *\/\npublic class Start {\n\n public static void main(String args[]) throws IOException, URISyntaxException {\n CLIInterface.call(args);\n\n if (!SystemProperties.getDefault().blocksLoader().equals(\"\")) {\n SystemProperties.getDefault().setSyncEnabled(false);\n SystemProperties.getDefault().setDiscoveryEnabled(false);\n }\n\n Ethereum ethereum = EthereumFactory.createEthereum();\n\n if (!SystemProperties.getDefault().blocksLoader().equals(\"\"))\n ethereum.getBlockLoader().loadBlocks();\n }\n\n}\n","new_contents":"package org.ethereum;\n\nimport org.ethereum.cli.CLIInterface;\nimport org.ethereum.config.SystemProperties;\nimport org.ethereum.facade.Ethereum;\nimport org.ethereum.facade.EthereumFactory;\nimport org.ethereum.mine.Ethash;\n\nimport java.io.IOException;\nimport java.net.URISyntaxException;\n\n\/**\n * @author Roman Mandeleil\n * @since 14.11.2014\n *\/\npublic class Start {\n\n public static void main(String args[]) throws IOException, URISyntaxException {\n CLIInterface.call(args);\n\n final SystemProperties config = SystemProperties.getDefault();\n final boolean actionBlocksLoader = !config.blocksLoader().equals(\"\");\n final boolean actionGenerateDag = config.getConfig().hasPath(\"ethash.blockNumber\");\n\n\n if (actionBlocksLoader || actionGenerateDag) {\n config.setSyncEnabled(false);\n config.setDiscoveryEnabled(false);\n }\n\n Ethereum ethereum = EthereumFactory.createEthereum();\n\n if (actionBlocksLoader) {\n ethereum.getBlockLoader().loadBlocks();\n } else if (actionGenerateDag) {\n new Ethash(config, config.getConfig().getLong(\"ethash.blockNumber\")).getFullDataset();\n \/\/ DAG file has been created, lets exit\n System.exit(0);\n }\n\n }\n\n}\n","subject":"Add ability to generate DAG file via command line"} {"old_contents":"\/\/ Adapted from\n\/\/ https:\/\/github.com\/gijoehosaphat\/react-native-keep-screen-on\n\npackage com.corbt.keepawake;\n\nimport android.app.Activity;\nimport android.view.WindowManager;\n\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\n\npublic class KCKeepAwake extends ReactContextBaseJavaModule {\n\n public KCKeepAwake(ReactApplicationContext reactContext) {\n super(reactContext);\n }\n\n @Override\n public String getName() {\n return \"KCKeepAwake\";\n }\n\n @ReactMethod\n public void activate() {\n final Activity activity = getCurrentActivity();\n activity.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n }\n });\n }\n\n @ReactMethod\n public void deactivate() {\n final Activity activity = getCurrentActivity();\n activity.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n activity.getWindow().clearFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n }\n });\n }\n}","new_contents":"\/\/ Adapted from\n\/\/ https:\/\/github.com\/gijoehosaphat\/react-native-keep-screen-on\n\npackage com.corbt.keepawake;\n\nimport android.app.Activity;\nimport android.view.WindowManager;\n\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMethod;\n\npublic class KCKeepAwake extends ReactContextBaseJavaModule {\n\n public KCKeepAwake(ReactApplicationContext reactContext) {\n super(reactContext);\n }\n\n @Override\n public String getName() {\n return \"KCKeepAwake\";\n }\n\n @ReactMethod\n public void activate() {\n final Activity activity = getCurrentActivity();\n\n if (activity != null) {\n activity.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n }\n });\n }\n }\n\n @ReactMethod\n public void deactivate() {\n final Activity activity = getCurrentActivity();\n\n if (activity != null) {\n activity.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n activity.getWindow().clearFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n }\n });\n }\n }\n}","subject":"Check is activity is null"} {"old_contents":"\/*\n * Kurento Android Media: Android Media Library based on FFmpeg.\n * Copyright (C) 2011 Tikal Technologies\n *\n * This program is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License version 3\n * as published by the Free Software Foundation.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n *\/\n\npackage com.kurento.kas.media.rx;\n\n\/**\n * \n * @author mparis\n * \n *\/\npublic class MediaRx {\n\tpublic static native int startVideoRx(String sdp_str, VideoRx videoPlayer);\n\tpublic static native int stopVideoRx();\n\t\n\tpublic static native int startAudioRx(String sdp_str, AudioRx audioPlayer);\n\tpublic static native int stopAudioRx();\n\t\n\tstatic {\n\t\tSystem.loadLibrary(\"kas-media-native\");\n\t}\n\t\n}\n","new_contents":"\/*\n * Kurento Android Media: Android Media Library based on FFmpeg.\n * Copyright (C) 2011 Tikal Technologies\n *\n * This program is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License version 3\n * as published by the Free Software Foundation.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n *\/\n\npackage com.kurento.kas.media.rx;\n\n\/**\n * \n * @author mparis\n * \n *\/\npublic class MediaRx {\n\tpublic static native int startVideoRx(String sdp_str, int maxDelay, VideoRx videoPlayer);\n\tpublic static native int stopVideoRx();\n\t\n\tpublic static native int startAudioRx(String sdp_str, int maxDelay, AudioRx audioPlayer);\n\tpublic static native int stopAudioRx();\n\t\n\tstatic {\n\t\tSystem.loadLibrary(\"kas-media-native\");\n\t}\n\t\n}\n","subject":"Add maxDelay param in startAudioRx and startVideoRx."} {"old_contents":"package org.mcupdater.mojang;\n\npublic enum DownloadType {\n\tCLIENT, SERVER, WINDOWS_SERVER\n}\n","new_contents":"package org.mcupdater.mojang;\n\npublic enum DownloadType {\n\tCLIENT, SERVER, WINDOWS_SERVER, CLIENT_MAPPINGS, SERVER_MAPPINGS\n}\n","subject":"Fix for Mojang's gift of deobf names."} {"old_contents":"\/**\n * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. \n * If a copy of the MPL was not distributed with this file, You can obtain one at \n * http:\/\/mozilla.org\/MPL\/2.0\/.\n * \n * This Source Code Form is also subject to the terms of the Health-Related Additional\n * Disclaimer of Warranty and Limitation of Liability available at\n * http:\/\/www.carewebframework.org\/licensing\/disclaimer.\n *\/\npackage org.carewebframework.api.domain;\n\nimport java.util.List;\n\n\/**\n * Interface for a domain object factory.\n * \n * @param The class of domain object serviced by the factory.\n *\/\npublic interface IDomainFactory {\n \n \/**\n * Creates a new instance of an object of this domain.\n * \n * @return The new domain object instance.\n *\/\n T newObject();\n \n \/**\n * Fetches an object, identified by its unique id, from the underlying data store.\n * \n * @param id Unique id of the object.\n * @return The requested object.\n *\/\n T fetchObject(long id);\n \n \/**\n * Fetches multiple domain objects as specified by an array of identifier values.\n * \n * @param ids An array of unique identifiers.\n * @return A list of domain objects in the same order as requested in the ids parameter.\n *\/\n List fetchObjects(long[] ids);\n \n}\n","new_contents":"\/**\n * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.\n * If a copy of the MPL was not distributed with this file, You can obtain one at\n * http:\/\/mozilla.org\/MPL\/2.0\/.\n *\n * This Source Code Form is also subject to the terms of the Health-Related Additional\n * Disclaimer of Warranty and Limitation of Liability available at\n * http:\/\/www.carewebframework.org\/licensing\/disclaimer.\n *\/\npackage org.carewebframework.api.domain;\n\nimport java.util.List;\n\n\/**\n * Interface for a domain object factory.\n *\n * @param The class of domain object serviced by the factory.\n *\/\npublic interface IDomainFactory {\n\n \/**\n * Creates a new instance of an object of this domain.\n *\n * @return The new domain object instance.\n *\/\n T newObject();\n\n \/**\n * Fetches an object, identified by its unique id, from the underlying data store.\n *\n * @param id Unique id of the object.\n * @return The requested object.\n *\/\n T fetchObject(String id);\n\n \/**\n * Fetches multiple domain objects as specified by an array of identifier values.\n *\n * @param ids An array of unique identifiers.\n * @return A list of domain objects in the same order as requested in the ids parameter.\n *\/\n List fetchObjects(String[] ids);\n\n}\n","subject":"Make domain id a String instead of long (more compatible with FHIR)."} {"old_contents":"package pl.minidmnv.apple.source.fixture.repository;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Optional;\n\nimport org.jsoup.nodes.Document;\n\nimport org.jsoup.select.Elements;\nimport pl.minidmnv.apple.source.fixture.data.Fixture;\nimport pl.minidmnv.apple.source.fixture.repository.picker.FSFixtureDOMElementPicker;\nimport pl.minidmnv.apple.source.fixture.tray.FixtureTray;\n\n\/**\n * @author mnicinski.\n *\/\npublic class FlashScoreFixtureRepository implements FixtureRepository {\n\n\tprivate FixtureTray fixtureTray;\n\tprivate FSFixtureDOMElementPicker picker = new FSFixtureDOMElementPicker();\n\n\t@Override\n\tpublic List getUpcomingFixtures(Integer limit) {\n\t\tList fixtures = new ArrayList();\n\t\tOptional upcomingFixturesDocument = fixtureTray.getUpcomingFixturesDocument();\n\n\t\tif (upcomingFixturesDocument.isPresent()) {\n\t\t\tDocument doc = upcomingFixturesDocument.get();\n\t\t\tpicker.init(doc);\n\t\t\tfixtures = parseFixtures(doc);\n\t\t}\n\n\t\treturn fixtures;\n\t}\n\n\tprivate List parseFixtures(Document document) {\n\t\tElements elements = picker.pickUpcomingFixtures();\n\t\treturn null;\n\t}\n}\n","new_contents":"package pl.minidmnv.apple.source.fixture.repository;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.stream.Collectors;\n\nimport org.jsoup.nodes.Document;\n\nimport org.jsoup.nodes.Element;\nimport org.jsoup.select.Elements;\nimport pl.minidmnv.apple.source.fixture.data.Fixture;\nimport pl.minidmnv.apple.source.fixture.repository.picker.FSFixtureDOMElementPicker;\nimport pl.minidmnv.apple.source.fixture.tray.FixtureTray;\n\n\/**\n * @author mnicinski.\n *\/\npublic class FlashScoreFixtureRepository implements FixtureRepository {\n\n\tprivate FixtureTray fixtureTray;\n\tprivate FSFixtureDOMElementPicker picker = new FSFixtureDOMElementPicker();\n\n\t@Override\n\tpublic List getUpcomingFixtures(Integer limit) {\n\t\tList fixtures = new ArrayList();\n\t\tOptional upcomingFixturesDocument = fixtureTray.getUpcomingFixturesDocument();\n\n\t\tif (upcomingFixturesDocument.isPresent()) {\n\t\t\tDocument doc = upcomingFixturesDocument.get();\n\n\t\t\tfixtures = parseFixtures(doc);\n\t\t}\n\n\t\treturn fixtures;\n\t}\n\n\tprivate List parseFixtures(Document doc) {\n\t\tpicker.init(doc);\n\t\tElements elements = picker.pickUpcomingFixtures();\n\n\t\treturn elements.stream()\n\t\t\t\t.map(this::transformStageScheduledElementToFixture)\n\t\t\t\t.collect(Collectors.toList());\n\t}\n\n\tprivate Fixture transformStageScheduledElementToFixture(Element e) {\n\t\tFixture result = new Fixture();\n\n\t\treturn result;\n\t}\n}\n","subject":"Prepare to supply fixtures from DOM elements"} {"old_contents":"\/\/\n\/\/ CommentSurgery.java\n\/\/\n\nimport loci.formats.TiffTools;\n\n\/**\n * Performs \"surgery\" on a TIFF ImageDescription comment, particularly the\n * OME-XML comment found in OME-TIFF files. Note that this code must be\n * tailored to a specific need by editing the commented out code below to\n * make desired alterations to the comment.\n *\/\npublic class CommentSurgery {\n public static void main(String[] args) throws Exception {\n \/\/ the -test flag will print proposed changes to stdout\n \/\/ rather than actually changing the comment\n boolean test = args[0].equals(\"-test\");\n int start = test ? 1 : 0;\n\n for (int i=0; i \" + xml.length());\n TiffTools.overwriteComment(id, xml);\n }\n }\n }\n}\n","new_contents":"\/\/\n\/\/ CommentSurgery.java\n\/\/\n\nimport loci.formats.tiff.TiffSaver;\nimport loci.formats.tiff.TiffTools;\n\n\/**\n * Performs \"surgery\" on a TIFF ImageDescription comment, particularly the\n * OME-XML comment found in OME-TIFF files. Note that this code must be\n * tailored to a specific need by editing the commented out code below to\n * make desired alterations to the comment.\n *\/\npublic class CommentSurgery {\n public static void main(String[] args) throws Exception {\n \/\/ the -test flag will print proposed changes to stdout\n \/\/ rather than actually changing the comment\n boolean test = args[0].equals(\"-test\");\n int start = test ? 1 : 0;\n\n for (int i=0; i \" + xml.length());\n TiffSaver.overwriteComment(id, xml);\n }\n }\n }\n}\n","subject":"Update to latest TIFF API."} {"old_contents":"package com.sequenceiq.it.cloudbreak.action.sdx;\n\nimport static java.lang.String.format;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport com.sequenceiq.it.cloudbreak.SdxClient;\nimport com.sequenceiq.it.cloudbreak.action.Action;\nimport com.sequenceiq.it.cloudbreak.context.TestContext;\nimport com.sequenceiq.it.cloudbreak.dto.sdx.SdxTestDto;\nimport com.sequenceiq.it.cloudbreak.log.Log;\n\npublic class SdxRepairAction implements Action {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(SdxRepairAction.class);\n\n @Override\n public SdxTestDto action(TestContext testContext, SdxTestDto testDto, SdxClient client) throws Exception {\n Log.when(LOGGER, format(\" Starting repair on SDX: %s \" + testDto.getName()));\n Log.whenJson(LOGGER, \" SDX repair request: \", testDto.getSdxRepairRequest());\n client.getSdxClient()\n .sdxEndpoint()\n .repairCluster(testDto.getName(), testDto.getSdxRepairRequest());\n Log.when(LOGGER, \" SDX repair have been initiated.\");\n return testDto;\n }\n}\n","new_contents":"package com.sequenceiq.it.cloudbreak.action.sdx;\n\nimport static java.lang.String.format;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport com.sequenceiq.it.cloudbreak.SdxClient;\nimport com.sequenceiq.it.cloudbreak.action.Action;\nimport com.sequenceiq.it.cloudbreak.context.TestContext;\nimport com.sequenceiq.it.cloudbreak.dto.sdx.SdxTestDto;\nimport com.sequenceiq.it.cloudbreak.log.Log;\n\npublic class SdxRepairAction implements Action {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(SdxRepairAction.class);\n\n @Override\n public SdxTestDto action(TestContext testContext, SdxTestDto testDto, SdxClient client) throws Exception {\n Log.when(LOGGER, format(\" Starting repair on SDX: %s \", testDto.getName()));\n Log.whenJson(LOGGER, \" SDX repair request: \", testDto.getSdxRepairRequest());\n client.getSdxClient()\n .sdxEndpoint()\n .repairCluster(testDto.getName(), testDto.getSdxRepairRequest());\n Log.when(LOGGER, \" SDX repair have been initiated.\");\n return testDto;\n }\n}\n","subject":"Fix string format usage since it caused the repair test failure"} {"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.apache.camel.test.blueprint;\n\nimport org.apache.camel.component.properties.PropertiesFunction;\nimport org.junit.Test;\n\npublic class PropertiesComponentFunctionTest extends CamelBlueprintTestSupport {\n\n public static final class MyFunction implements PropertiesFunction {\n\n @Override\n public String getName() {\n return \"beer\";\n }\n\n @Override\n public String apply(String remainder) {\n return \"mock:\" + remainder.toLowerCase();\n }\n }\n\n @Override\n protected String getBlueprintDescriptor() {\n return \"org\/apache\/camel\/test\/blueprint\/PropertiesComponentFunctionTest.xml\";\n }\n\n @Test\n public void testFunction() throws Exception {\n getMockEndpoint(\"mock:foo\").expectedMessageCount(1);\n getMockEndpoint(\"mock:bar\").expectedMessageCount(1);\n\n template.sendBody(\"direct:start\", \"Hello World\");\n\n assertMockEndpointsSatisfied();\n }\n\n}\n\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.apache.camel.test.blueprint;\n\nimport org.apache.camel.spi.PropertiesFunction;\nimport org.junit.Test;\n\npublic class PropertiesComponentFunctionTest extends CamelBlueprintTestSupport {\n\n public static final class MyFunction implements PropertiesFunction {\n\n @Override\n public String getName() {\n return \"beer\";\n }\n\n @Override\n public String apply(String remainder) {\n return \"mock:\" + remainder.toLowerCase();\n }\n }\n\n @Override\n protected String getBlueprintDescriptor() {\n return \"org\/apache\/camel\/test\/blueprint\/PropertiesComponentFunctionTest.xml\";\n }\n\n @Test\n public void testFunction() throws Exception {\n getMockEndpoint(\"mock:foo\").expectedMessageCount(1);\n getMockEndpoint(\"mock:bar\").expectedMessageCount(1);\n\n template.sendBody(\"direct:start\", \"Hello World\");\n\n assertMockEndpointsSatisfied();\n }\n\n}\n\n","subject":"Make PropertiesFunction part of the PropertiesComponent SPI"} {"old_contents":"package com.fenixinfotech.aspectj.playpen;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n\/**\n * Created by 700608667 on 11\/09\/2015.\n *\/\npublic class AspectedFunctionalityTest\n{\n\n @Test\n public void testPower() throws Exception\n {\n new AspectedFunctionality().power(2, 3);\n }\n}","new_contents":"package com.fenixinfotech.aspectj.playpen;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n\/**\n * Created by 700608667 on 11\/09\/2015.\n *\/\npublic class AspectedFunctionalityTest\n{\n\n @Test\n public void testPower() throws Exception\n {\n assertEquals(8, new AspectedFunctionality().power(2, 3), 0);\n }\n}","subject":"Check expected output of aspected operation."} {"old_contents":"package org.wso2.carbon.apimgt.core.configuration.models;\n\nimport org.wso2.carbon.apimgt.core.util.APIMgtConstants;\nimport org.wso2.carbon.config.annotation.Configuration;\nimport org.wso2.carbon.config.annotation.Element;\n\nimport java.util.Collections;\nimport java.util.List;\n\n\/**\n * Class to hold Environment configurations\n *\/\n@Configuration(description = \"Environment Configurations\")\npublic class EnvironmentConfigurations {\n @Element(description = \"list of web clients (eg: 127.0.0.1:9292) allowed to make requests to the current environment\\n\" +\n \"(use '\" + APIMgtConstants.CORSAllowOriginConstants.ALLOW_ALL_ORIGINS + \"' to allow any web client)\")\n private List allowedHosts = Collections.singletonList(\n APIMgtConstants.CORSAllowOriginConstants.ALLOW_ALL_ORIGINS);\n\n \/\/Unique name for environment to set cookies by backend\n @Element(description = \"current environment's label from the list of environments\")\n private String environmentLabel = \"Default\";\n\n public List getAllowedHosts() {\n return allowedHosts;\n }\n\n public void setAllowedHosts(List allowedHosts) {\n this.allowedHosts = allowedHosts;\n }\n\n public String getEnvironmentLabel() {\n return environmentLabel;\n }\n\n public void setEnvironmentLabel(String environmentLabel) {\n this.environmentLabel = environmentLabel;\n }\n}\n","new_contents":"package org.wso2.carbon.apimgt.core.configuration.models;\n\nimport org.wso2.carbon.apimgt.core.util.APIMgtConstants;\nimport org.wso2.carbon.config.annotation.Configuration;\nimport org.wso2.carbon.config.annotation.Element;\n\nimport java.util.Collections;\nimport java.util.List;\n\n\/**\n * Class to hold Environment configurations\n *\/\n@Configuration(description = \"Environment Configurations\")\npublic class EnvironmentConfigurations {\n @Element(description = \"list of web clients (eg: 127.0.0.1:9292) to allow make requests\"\n + \"to current environment\\n(use '\" + APIMgtConstants.CORSAllowOriginConstants.ALLOW_ALL_ORIGINS +\n \"' to allow any web client)\")\n private List allowedHosts = Collections.singletonList(\n APIMgtConstants.CORSAllowOriginConstants.ALLOW_ALL_ORIGINS);\n\n \/\/Unique name for environment to set cookies by backend\n @Element(description = \"current environment's label from the list of environments\")\n private String environmentLabel = \"Default\";\n\n public List getAllowedHosts() {\n return allowedHosts;\n }\n\n public void setAllowedHosts(List allowedHosts) {\n this.allowedHosts = allowedHosts;\n }\n\n public String getEnvironmentLabel() {\n return environmentLabel;\n }\n\n public void setEnvironmentLabel(String environmentLabel) {\n this.environmentLabel = environmentLabel;\n }\n}\n","subject":"Fix check style issue exceeding no of chars in one line"} {"old_contents":"package io.pivotal.labs.cfenv;\n\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Scanner;\n\npublic class ResourceUtils {\n\n public static String loadResource(String name) throws IOException {\n try (InputStream stream = openResource(name)) {\n Scanner scanner = new Scanner(stream, StandardCharsets.UTF_8.name()).useDelimiter(\"\\\\z\");\n String content = scanner.next();\n IOException exception = scanner.ioException();\n if (exception != null) throw exception;\n return content;\n }\n }\n\n public static InputStream openResource(String name) throws FileNotFoundException {\n InputStream stream = ResourceUtils.class.getResourceAsStream(name);\n if (stream == null) throw new FileNotFoundException(name);\n return stream;\n }\n\n}\n","new_contents":"package io.pivotal.labs.cfenv;\n\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\n\npublic class ResourceUtils {\n\n public static String loadResource(String name) throws IOException {\n try (InputStream stream = openResource(name)) {\n StringBuilder buffer = new StringBuilder();\n InputStreamReader reader = new InputStreamReader(stream);\n while (true) {\n int character = reader.read();\n if (character == -1) break;\n buffer.append((char) character);\n }\n return buffer.toString();\n }\n }\n\n public static InputStream openResource(String name) throws FileNotFoundException {\n InputStream stream = ResourceUtils.class.getResourceAsStream(name);\n if (stream == null) throw new FileNotFoundException(name);\n return stream;\n }\n\n}\n","subject":"Fix resource loading to work with files bigger than a kilobyte"} {"old_contents":"\/\/ Copyright 2011 Google Inc. All Rights Reserved.\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.hughes.util;\n\nimport java.util.Map;\n\n@SuppressWarnings({\"WeakerAccess\", \"unused\"})\npublic class MapUtil {\n\n public static V safeGet(final Map map, K key, V defaultValue) {\n if (!map.containsKey(key)) {\n return defaultValue;\n }\n return map.get(key);\n }\n\n public static V safeGetOrPut(final Map map, K key, V defaultValue) {\n if (!map.containsKey(key)) {\n map.put(key, defaultValue);\n }\n return map.get(key);\n }\n\n public static V safeGet(final Map map, K key, Class valueClass) {\n if (!map.containsKey(key)) {\n try {\n map.put(key, valueClass.newInstance());\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }\n return map.get(key);\n }\n\n public static V safeRemove(final Map map, K key, V defaultValue) {\n if (!map.containsKey(key)) {\n return defaultValue;\n }\n return map.remove(key);\n }\n\n\n}\n","new_contents":"\/\/ Copyright 2011 Google Inc. All Rights Reserved.\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.hughes.util;\n\nimport java.util.Map;\n\npublic class MapUtil {\n public static V safeRemove(final Map map, K key, V defaultValue) {\n if (!map.containsKey(key)) {\n return defaultValue;\n }\n return map.remove(key);\n }\n}\n","subject":"Remove unused functions that cause warnings."} {"old_contents":"package uk.ac.ebi.quickgo.repo.solr;\n\nimport org.junit.ClassRule;\nimport org.junit.rules.ExternalResource;\nimport org.junit.rules.TemporaryFolder;\n\nimport java.io.IOException;\n\n\/**\n * Creates a temporary solr data store, which is deleted on exit. Use this class with\n * the annotation, @ClassRule in tests requiring a temporary solr data store.\n *\n * Created 13\/11\/15\n * @author Edd\n *\/\npublic class TemporarySolrDataStore extends ExternalResource {\n \/\/ the property defining the solr data store, used in solr core's solrconfig.xml files\n private static final String SOLR_DATA_DIR = \"solr.data.dir\";\n\n @ClassRule\n public static TemporaryFolder temporaryFolder = new TemporaryFolder();\n\n @Override\n public void before() throws IOException {\n temporaryFolder.create();\n System.setProperty(SOLR_DATA_DIR, temporaryFolder.getRoot().getAbsolutePath());\n }\n\n @Override\n public void after() {\n temporaryFolder.delete();\n }\n}\n","new_contents":"package uk.ac.ebi.quickgo.repo.solr;\n\nimport java.io.File;\nimport org.junit.ClassRule;\nimport org.junit.rules.ExternalResource;\nimport org.junit.rules.TemporaryFolder;\n\nimport java.io.IOException;\n\n\/**\n * Creates a temporary solr data store, which is deleted on exit. Use this class with\n * the annotation, @ClassRule in tests requiring a temporary solr data store.\n *\n * Created 13\/11\/15\n * @author Edd\n *\/\npublic class TemporarySolrDataStore extends ExternalResource {\n \/\/ the following properties are defined in the solrconfig.xml files\n private static final String SOLR_DATA_DIR = \"solr.data.dir\";\n private static final String SOLR_PLUGIN_JAR = \"solr.similarity.plugin\";\n\n @ClassRule\n public static TemporaryFolder temporaryFolder = new TemporaryFolder();\n\n @Override\n public void before() throws IOException {\n temporaryFolder.create();\n System.setProperty(SOLR_DATA_DIR, temporaryFolder.getRoot().getAbsolutePath());\n System.setProperty(SOLR_PLUGIN_JAR, pathToSimilarityPlugin());\n }\n\n private String pathToSimilarityPlugin() {\n File file = new File(\"..\/solr-plugin\/target\/similarity_plugin.jar\");\n\n if(!file.exists()) {\n throw new IllegalStateException(\"similarity_plugin.jar does not exist. Please generated the jar before \" +\n \"running the tests\");\n }\n\n return file.getAbsolutePath();\n }\n\n @Override\n public void after() {\n temporaryFolder.delete();\n }\n}\n","subject":"Add custom solr similarity plugin so solrconfig can pick it up."} {"old_contents":"package hello;\n\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.junit.Assert.assertThat;\n\nimport java.net.MalformedURLException;\nimport java.net.URL;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.boot.context.embedded.LocalServerPort;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.boot.test.web.client.TestRestTemplate;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.http.ResponseEntity;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)\npublic class GreetingControllerIntegrationTest {\n\n\t@LocalServerPort\n\tprivate int port;\n\n\tprivate URL greeting;\n\n\t@Autowired\n\tprivate TestRestTemplate template;\n\n\t@Before\n\tpublic void setUp() throws MalformedURLException {\n\t\tthis.greeting = new URL(\"http:\/\/localhost:\" + port + \"\/greeting\");\n\t}\n\n\t@Test\n\tpublic void getGreeting() {\n\t\tResponseEntity response = template.getForEntity(greeting.toString(), String.class);\n\t\tassertThat(response.getStatusCode(), equalTo(HttpStatus.OK));\n\t}\n\n}\n","new_contents":"package hello;\n\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.hamcrest.core.StringContains.containsString;\nimport static org.junit.Assert.assertThat;\n\nimport java.net.MalformedURLException;\nimport java.net.URL;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.boot.context.embedded.LocalServerPort;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.boot.test.web.client.TestRestTemplate;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.http.ResponseEntity;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)\npublic class GreetingControllerIntegrationTest {\n\n\t@LocalServerPort\n\tprivate int port;\n\n\tprivate URL greeting;\n\n\t@Autowired\n\tprivate TestRestTemplate template;\n\n\t@Before\n\tpublic void setUp() throws MalformedURLException {\n\t\tthis.greeting = new URL(\"http:\/\/localhost:\" + port + \"\/greeting\");\n\t}\n\n\t@Test\n\tpublic void getGreeting() {\n\t\tResponseEntity response = template.getForEntity(greeting.toString(), String.class);\n\t\tassertThat(response.getStatusCode(), equalTo(HttpStatus.OK));\n\t\tassertThat(response.getBody(), containsString(\"Hello, World!\"));\n\t}\n\n}\n","subject":"Test view content in greeting integration test."} {"old_contents":"package org.puller;\n\nimport org.kohsuke.args4j.Localizable;\n\nimport java.util.Locale;\n\npublic class LocalizedString implements Localizable {\n private final String msg;\n\n public LocalizedString(final String msg) {\n this.msg = msg;\n }\n\n @Override\n public String formatWithLocale(final Locale locale, final Object... args) {\n return String.format(locale, msg, args);\n }\n\n @Override\n public String format(final Object... args) {\n return formatWithLocale(Locale.getDefault(), args);\n }\n}\n","new_contents":"package org.puller;\n\nimport org.kohsuke.args4j.Localizable;\n\nimport java.text.MessageFormat;\nimport java.util.Locale;\n\npublic class LocalizedString implements Localizable {\n private final String msg;\n\n public LocalizedString(final String msg) {\n this.msg = msg;\n }\n\n @Override\n public String formatWithLocale(final Locale locale, final Object... args) {\n return MessageFormat.format(msg, args);\n }\n\n @Override\n public String format(final Object... args) {\n return formatWithLocale(Locale.getDefault(), args);\n }\n}\n","subject":"Use MessageFormat to format localized strings"} {"old_contents":"package net.simpvp.NoSpam;\n\nimport org.bukkit.entity.Player;\nimport org.bukkit.event.EventHandler;\nimport org.bukkit.event.EventPriority;\nimport org.bukkit.event.Listener;\nimport org.bukkit.event.player.PlayerCommandPreprocessEvent;\n\npublic class CommandListener implements Listener {\n\n\tpublic CommandListener(NoSpam plugin) {\n\t\tplugin.getServer().getPluginManager().registerEvents(this, plugin);\n\t}\n\n\t@EventHandler(priority=EventPriority.LOW, ignoreCancelled=false)\n\tpublic void onPlayerCommandPreprocessEvent(PlayerCommandPreprocessEvent event) {\n\n\t\tPlayer player = event.getPlayer();\n\n\t\tString message = event.getMessage();\n\n\t\t\/* Important: The spaces afterwards are necessary. Otherwise we get something like this being activated on \/world because of \/w *\/\n\t\tif (message.startsWith(\"\/tell \")\n\t\t\t\t|| message.startsWith(\"\/me \")\n\t\t\t\t|| message.startsWith(\"\/msg \")\n\t\t\t\t|| message.startsWith(\"\/w \")\n\t\t\t\t|| message.startsWith(\"\/op \")) {\n\n\t\t\tboolean cancel = SpamHandler.isSpamming(player); \/\/ The Handler class checks if it's spam\n\n\t\t\tif ( cancel ) event.setCancelled(true);\n\n\t\t\t\t}\n\n\t}\n\n}\n\n","new_contents":"package net.simpvp.NoSpam;\n\nimport org.bukkit.entity.Player;\nimport org.bukkit.event.EventHandler;\nimport org.bukkit.event.EventPriority;\nimport org.bukkit.event.Listener;\nimport org.bukkit.event.player.PlayerCommandPreprocessEvent;\n\npublic class CommandListener implements Listener {\n\n\tpublic CommandListener(NoSpam plugin) {\n\t\tplugin.getServer().getPluginManager().registerEvents(this, plugin);\n\t}\n\n\t@EventHandler(priority=EventPriority.LOW, ignoreCancelled=false)\n\tpublic void onPlayerCommandPreprocessEvent(PlayerCommandPreprocessEvent event) {\n\n\t\tPlayer player = event.getPlayer();\n\n\t\tString message = event.getMessage().toLowerCase();\n\n\t\t\/* Important: The spaces afterwards are necessary. Otherwise we get something like this being activated on \/world because of \/w *\/\n\t\tif (message.startsWith(\"\/tell \")\n\t\t\t\t|| message.startsWith(\"\/me \")\n\t\t\t\t|| message.startsWith(\"\/msg \")\n\t\t\t\t|| message.startsWith(\"\/w \")\n\t\t\t\t|| message.startsWith(\"\/op \")\n\t\t\t\t|| message.equals(\"\/op\")) {\n\n\t\t\tboolean cancel = SpamHandler.isSpamming(player); \/\/ The Handler class checks if it's spam\n\n\t\t\tif ( cancel ) event.setCancelled(true);\n\n\t\t}\n\n\t}\n\n}\n\n","subject":"Update list of blocked commands"} {"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.hp.hpl.jena.tdb.nodetable;\n\npublic class NodeTableReadonly extends NodeTableWrapper\n{\n public NodeTableReadonly(NodeTable nodeTable)\n {\n super(nodeTable) ;\n }\n\n}\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.hp.hpl.jena.tdb.nodetable;\n\nimport com.hp.hpl.jena.graph.Node ;\nimport com.hp.hpl.jena.tdb.TDBException ;\nimport com.hp.hpl.jena.tdb.store.NodeId ;\n\npublic class NodeTableReadonly extends NodeTableWrapper\n{\n public NodeTableReadonly(NodeTable nodeTable)\n {\n super(nodeTable) ;\n }\n\n @Override\n public NodeId getAllocateNodeId(Node node)\n {\n NodeId nodeId = getNodeIdForNode(node) ;\n if ( NodeId.isDoesNotExist(nodeId) )\n throw new TDBException(\"Allocation attempt on NodeTableReadonly\") ;\n return nodeId ;\n }\n}\n","subject":"Make a read-only node table check it is used read-only."} {"old_contents":"package net.kencochrane.raven.log4j;\n\nimport net.kencochrane.raven.stub.SentryStub;\nimport org.apache.log4j.Logger;\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\npublic class SentryAppenderIT {\n private static final Logger logger = Logger.getLogger(SentryAppenderIT.class);\n private SentryStub sentryStub;\n\n @Before\n public void setUp() {\n sentryStub = new SentryStub();\n sentryStub.removeEvents();\n }\n\n @After\n public void tearDown() {\n sentryStub.removeEvents();\n }\n\n @Test\n public void testInfoLog() {\n assertThat(sentryStub.getEventCount(), is(0));\n logger.info(\"This is a test\");\n assertThat(sentryStub.getEventCount(), is(1));\n }\n\n @Test\n public void testChainedExceptions() {\n assertThat(sentryStub.getEventCount(), is(0));\n logger.error(\"This is an exception\",\n new UnsupportedOperationException(\"Test\", new UnsupportedOperationException()));\n assertThat(sentryStub.getEventCount(), is(1));\n }\n}\n","new_contents":"package net.kencochrane.raven.log4j;\n\nimport net.kencochrane.raven.stub.SentryStub;\nimport org.apache.log4j.Logger;\nimport org.testng.annotations.AfterMethod;\nimport org.testng.annotations.Test;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\npublic class SentryAppenderIT {\n private static final Logger logger = Logger.getLogger(SentryAppenderIT.class);\n private SentryStub sentryStub = new SentryStub();\n\n @AfterMethod\n public void tearDown() {\n sentryStub.removeEvents();\n }\n\n @Test\n public void testInfoLog() {\n assertThat(sentryStub.getEventCount(), is(0));\n logger.info(\"This is a test\");\n assertThat(sentryStub.getEventCount(), is(1));\n }\n\n @Test\n public void testChainedExceptions() {\n assertThat(sentryStub.getEventCount(), is(0));\n logger.error(\"This is an exception\",\n new UnsupportedOperationException(\"Test\", new UnsupportedOperationException()));\n assertThat(sentryStub.getEventCount(), is(1));\n }\n}\n","subject":"Move from junit to testng for integration tests"} {"old_contents":"package org.pitest.cucumber;\n\n\nimport org.pitest.junit.CompoundTestUnitFinder;\nimport org.pitest.junit.JUnitCompatibleConfiguration;\nimport org.pitest.testapi.TestGroupConfig;\nimport org.pitest.testapi.TestUnitFinder;\nimport org.pitest.util.Log;\n\nimport java.util.List;\n\nimport static java.util.Arrays.asList;\n\npublic class CucumberJUnitCompatibleConfiguration extends JUnitCompatibleConfiguration {\n\n public CucumberJUnitCompatibleConfiguration(TestGroupConfig config) {\n super(config);\n }\n\n @Override\n public TestUnitFinder testUnitFinder() {\n final TestUnitFinder finder;\n if (isCucumberUsed()) {\n Log.getLogger().info(\"Cucumber detected, scenarios will be used\");\n List finders\n = asList(new CucumberTestUnitFinder(), super.testUnitFinder());\n finder = new CompoundTestUnitFinder(finders);\n } else {\n Log.getLogger().info(\"Cucumber not used in this project\");\n finder = super.testUnitFinder();\n }\n return finder;\n }\n\n private boolean isCucumberUsed() {\n boolean result = false;\n try {\n Class.forName(\"cucumber.api.junit.Cucumber\");\n result = true;\n } catch (ClassNotFoundException e) {\n }\n return result;\n }\n}\n","new_contents":"package org.pitest.cucumber;\n\n\nimport org.pitest.junit.CompoundTestUnitFinder;\nimport org.pitest.junit.JUnitCompatibleConfiguration;\nimport org.pitest.testapi.TestGroupConfig;\nimport org.pitest.testapi.TestUnitFinder;\nimport org.pitest.util.Log;\n\nimport java.util.List;\n\nimport static java.util.Arrays.asList;\n\npublic class CucumberJUnitCompatibleConfiguration extends JUnitCompatibleConfiguration {\n\n public CucumberJUnitCompatibleConfiguration(TestGroupConfig config) {\n super(config);\n }\n\n @Override\n public TestUnitFinder testUnitFinder() {\n final TestUnitFinder finder;\n if (isCucumberUsed()) {\n Log.getLogger().fine(\"Cucumber detected, scenarios will be used\");\n List finders\n = asList(new CucumberTestUnitFinder(), super.testUnitFinder());\n finder = new CompoundTestUnitFinder(finders);\n } else {\n Log.getLogger().fine(\"Cucumber not used in this project\");\n finder = super.testUnitFinder();\n }\n return finder;\n }\n\n private boolean isCucumberUsed() {\n boolean result = false;\n try {\n Class.forName(\"cucumber.api.junit.Cucumber\");\n result = true;\n } catch (ClassNotFoundException e) {\n }\n return result;\n }\n}\n","subject":"Reduce log level to avoid log polution"} {"old_contents":"\npublic class Sort {\n\tpublic enum DIRECTION {ASCENDING,DESCENDING};\n\t\n\tpublic void sort(Table _targetTable, DIRECTION d) {\n\t\t\n\t}\n}\n","new_contents":"\npublic class Sort {\n\n}\n","subject":"Revert \"Started the sort method\""} {"old_contents":"\/**\n * Copyright 2015 Palantir Technologies\n *\n * Licensed under the BSD-3 License (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/opensource.org\/licenses\/BSD-3-Clause\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.palantir.atlasdb.config;\n\nimport java.io.File;\nimport java.io.IOException;\n\nimport javax.annotation.Nullable;\n\npublic final class AtlasDbConfigs {\n public static final String ATLASDB_CONFIG_ROOT = \"\/atlasdb\";\n\n private AtlasDbConfigs() {\n \/\/ uninstantiable\n }\n\n public static AtlasDbConfig load(File configFile) throws IOException {\n return load(configFile, ATLASDB_CONFIG_ROOT);\n }\n\n public static AtlasDbConfig load(File configFile, @Nullable String configRoot) throws IOException {\n ConfigFinder finder = new ConfigFinder(configRoot);\n return finder.getConfig(configFile);\n }\n\n public static AtlasDbConfig loadFromString(String fileContents, @Nullable String configRoot) throws IOException {\n ConfigFinder finder = new ConfigFinder(configRoot);\n return finder.getConfig(fileContents);\n }\n}\n","new_contents":"\/**\n * Copyright 2015 Palantir Technologies\n *\n * Licensed under the BSD-3 License (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/opensource.org\/licenses\/BSD-3-Clause\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.palantir.atlasdb.config;\n\nimport java.io.File;\nimport java.io.IOException;\n\nimport com.fasterxml.jackson.databind.JsonNode;\n\npublic final class AtlasDbConfigs {\n public static final String ATLASDB_CONFIG_ROOT = \"\/atlasdb\";\n\n private AtlasDbConfigs() {\n \/\/ uninstantiable\n }\n\n public static AtlasDbConfig load(File configFile) throws IOException {\n return load(configFile, ATLASDB_CONFIG_ROOT);\n }\n\n public static AtlasDbConfig load(File configFile, String configRoot) throws IOException {\n ConfigFinder finder = new ConfigFinder(configRoot);\n return finder.getConfig(configFile);\n }\n\n public static AtlasDbConfig loadFromString(String fileContents, String configRoot) throws IOException {\n ConfigFinder finder = new ConfigFinder(configRoot);\n return finder.getConfig(fileContents);\n }\n}\n","subject":"Revert \"Update nullables and unused import\""} {"old_contents":"\n\npublic class Tuple implements Comparable {\n\tprivate String contents;\n\tpublic Tuple(String contents) {\n\t\tthis.contents = contents;\n\t}\n\tpublic String toString() {\n\t\treturn \"TUPLE {\" + contents + \"}\";\n\t}\n\tpublic boolean equals(Object o) {\n\t\treturn contents.equals(((Tuple)o).contents);\n\t}\n\t@Override\n\tpublic int compareTo(Tuple o) {\n\t\treturn contents.compareTo(o.contents);\n\t}\n\tpublic int hashCode() {\n\t\treturn contents.hashCode();\n\t}\n}\n","new_contents":"\npublic class Tuple implements Comparable {\n\tprivate String contents;\n\n\tpublic Tuple(String contents) {\n\t\tthis.contents = contents;\n\t}\n\n\t@Override\n\tpublic String toString() {\n\t\treturn \"TUPLE {\" + contents + \"}\";\n\t}\n\n\t@Override\n\tpublic boolean equals(Object o) {\n\t\treturn contents.equals(((Tuple) o).contents);\n\t}\n\n\t@Override\n\tpublic int compareTo(Tuple o) {\n\t\treturn contents.compareTo(o.contents);\n\t}\n\n\t@Override\n\tpublic int hashCode() {\n\t\treturn contents.hashCode();\n\t}\n}\n","subject":"Tweak formatting and add @OverrideS."} {"old_contents":"\/**\r\n * Abstract Syntax Tree for JUnit.\r\n * \r\n *

      \r\n * CompilationUnit ::= ClassDecl\r\n * \r\n * ClassDecl ::= TestMethod*\r\n * \r\n * TestMethod ::= Binding* TestStateMent*\r\n * \r\n * TestStatement ::= IsStatement\r\n *                 | IsNotStatement\r\n *                 | ThrowsStatement\r\n * <\/pre>\r\n * \r\n *\/\r\npackage yokohama.unit.ast_junit;","new_contents":"\/**\r\n * Abstract Syntax Tree for JUnit.\r\n * \r\n * 
      \r\n * CompilationUnit ::= ClassDecl\r\n * \r\n * ClassDecl ::= TestMethod*\r\n * \r\n * TestMethod ::= Binding* ActionStatement* TestStateMent* ActionStatement*\r\n * \r\n * TestStatement ::= IsStatement\r\n *                 | IsNotStatement\r\n *                 | ThrowsStatement\r\n * <\/pre>\r\n * \r\n *\/\r\npackage yokohama.unit.ast_junit;","subject":"Change BNF description for JUnit AST"}
      {"old_contents":"\/*-------------------------------------------------------------------------\n*\n* Copyright (c) 2004-2005, PostgreSQL Global Development Group\n*\n* IDENTIFICATION\n*   $PostgreSQL: pgjdbc\/org\/postgresql\/util\/PSQLDriverVersion.java,v 1.20 2006\/12\/01 12:02:39 jurka Exp $\n*\n*-------------------------------------------------------------------------\n*\/\npackage org.postgresql.util;\n\nimport org.postgresql.Driver;\n\n\/**\n * This class holds the current build number and a utility program to print\n * it and the file it came from.  The primary purpose of this is to keep\n * from filling the cvs history of Driver.java.in with commits simply\n * changing the build number.  The utility program can also be helpful for\n * people to determine what version they really have and resolve problems\n * with old and unknown versions located somewhere in the classpath.\n *\/\npublic class PSQLDriverVersion {\n\n    public static int buildNumber = 600;\n\n    public static void main(String args[]) {\n        java.net.URL url = Driver.class.getResource(\"\/org\/postgresql\/Driver.class\");\n        System.out.println(Driver.getVersion());\n        System.out.println(\"Found in: \" + url);\n    }\n\n}\n","new_contents":"\/*-------------------------------------------------------------------------\n*\n* Copyright (c) 2004-2005, PostgreSQL Global Development Group\n*\n* IDENTIFICATION\n*   $PostgreSQL: pgjdbc\/org\/postgresql\/util\/PSQLDriverVersion.java,v 1.21 2006\/12\/01 12:06:21 jurka Exp $\n*\n*-------------------------------------------------------------------------\n*\/\npackage org.postgresql.util;\n\nimport org.postgresql.Driver;\n\n\/**\n * This class holds the current build number and a utility program to print\n * it and the file it came from.  The primary purpose of this is to keep\n * from filling the cvs history of Driver.java.in with commits simply\n * changing the build number.  The utility program can also be helpful for\n * people to determine what version they really have and resolve problems\n * with old and unknown versions located somewhere in the classpath.\n *\/\npublic class PSQLDriverVersion {\n\n    public final static int buildNumber = 601;\n\n    public static void main(String args[]) {\n        java.net.URL url = Driver.class.getResource(\"\/org\/postgresql\/Driver.class\");\n        System.out.println(Driver.getVersion());\n        System.out.println(\"Found in: \" + url);\n    }\n\n}\n","subject":"Prepare for release for 8.3dev-601."}
      {"old_contents":"package in.co.nebulax.magpie;\n\npublic class Constants {\n\n\t\/\/ url to get data JSON\n\tpublic static String url = \"http:\/\/10.0.2.2:1111\/all\";\n\t\n\t\/\/JSON Node Names\n\tpublic static String TAG_DATA = \"data\";\n\tpublic static String TAG_DEVICE = \"device\";\n\tpublic static String TAG_STATUS = \"status\";\n\tpublic static String TAG_NAME = \"name\";\n}\n","new_contents":"package in.co.nebulax.magpie;\n\npublic class Constants {\n\n\t\/\/ url to get data JSON\n\tpublic static String urlGet = \"http:\/\/10.0.2.2:1111\/all\";\n\tpublic static String urlPost = \"http:\/\/10.0.2.2:1111\/change\";\n\t\n\t\/\/JSON Node Names\n\tpublic static String TAG_DATA = \"data\";\n\tpublic static String TAG_DEVICE = \"device\";\n\tpublic static String TAG_STATUS = \"status\";\n\tpublic static String TAG_NAME = \"name\";\n}\n","subject":"Add url for post request"}
      {"old_contents":"package org.fest.assertions.api.android;\n\nimport java.util.List;\n\npublic final class Utils {\n  public static String join(List parts) {\n    StringBuilder builder = new StringBuilder();\n    for (String part : parts) {\n      if (builder.length() > 0) {\n        builder.append(\", \");\n      }\n      builder.append(part);\n    }\n    return builder.toString();\n  }\n\n  private Utils() {\n    \/\/ No instances.\n  }\n}\n","new_contents":"package org.fest.assertions.api.android;\n\nimport android.text.TextUtils;\nimport java.util.List;\n\npublic final class Utils {\n  public static String join(List parts) {\n    return TextUtils.join(\", \", parts);\n  }\n\n  private Utils() {\n    \/\/ No instances.\n  }\n}\n","subject":"Change custom String joiner to use framework one."}
      {"old_contents":"package org.aikodi.chameleon.util;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\n\/**\n * A debugging class that stores the current stacktrace.\n * \n * @author Marko van Dooren\n *\/\npublic class CreationStackTrace {\n\n\tprivate StackTraceElement[] _stackTrace;\n\n\tpublic List trace() {\n\t\treturn new ArrayList(Arrays.asList(_stackTrace));\n\t}\n\t\n\tpublic CreationStackTrace() {\n\t\ttry {\n\t\t\tthrow new Exception();\n\t\t} catch (Exception e) {\n\t\t\t_stackTrace = e.getStackTrace();\n\t\t}\n\t}\n\t\n}\n","new_contents":"package org.aikodi.chameleon.util;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\n\/**\n * A debugging class that stores the current stacktrace.\n * \n * @author Marko van Dooren\n *\/\npublic class CreationStackTrace {\n\n\tprivate List _stackTrace;\n\n\tpublic List trace() {\n\t\treturn new ArrayList(_stackTrace);\n\t}\n\t\n\tpublic CreationStackTrace() {\n\t\ttry {\n\t\t\tthrow new Exception();\n\t\t} catch (Exception e) {\n\t\t\t_stackTrace = Arrays.asList(e.getStackTrace());\n\t\t}\n\t}\n\t\n  public CreationStackTrace(int size) {\n    try {\n      throw new Exception();\n    } catch (Exception e) {\n      _stackTrace = Arrays.asList(e.getStackTrace()).subList(0, size);\n    }\n  }\n}\n","subject":"Allow taking a limited snapshot of the full trace"}
      {"old_contents":"\/**\n * Copyright (c) 2012-2013 André Bargull\n * Alle Rechte vorbehalten \/ All Rights Reserved.  Use is subject to license terms.\n *\n * \n *\/\npackage com.github.anba.es6draft.runtime.internal;\n\nimport com.github.anba.es6draft.runtime.ExecutionContext;\n\n\/**\n * Base class for internal exceptions\n *\/\n@SuppressWarnings(\"serial\")\npublic abstract class InternalException extends java.lang.RuntimeException {\n    \/**\n     * {@inheritDoc}\n     *\/\n    public InternalException() {\n        super();\n    }\n\n    \/**\n     * {@inheritDoc}\n     *\/\n    public InternalException(String message) {\n        super(message);\n    }\n\n    \/**\n     * {@inheritDoc}\n     *\/\n    public InternalException(String message, Throwable cause) {\n        super(message, cause);\n    }\n\n    \/**\n     * {@inheritDoc}\n     *\/\n    public InternalException(Throwable cause) {\n        super(cause);\n    }\n\n    \/**\n     * {@inheritDoc}\n     *\/\n    protected InternalException(String message, Throwable cause, boolean enableSuppression,\n            boolean writableStackTrace) {\n        super(message, cause, enableSuppression, writableStackTrace);\n    }\n\n    \/**\n     * Returns a {@link ScriptException} for this exception object\n     *\/\n    public abstract ScriptException toScriptException(ExecutionContext cx);\n}\n","new_contents":"\/**\n * Copyright (c) 2012-2013 André Bargull\n * Alle Rechte vorbehalten \/ All Rights Reserved.  Use is subject to license terms.\n *\n * \n *\/\npackage com.github.anba.es6draft.runtime.internal;\n\nimport com.github.anba.es6draft.runtime.ExecutionContext;\n\n\/**\n * Base class for internal exceptions\n *\/\n@SuppressWarnings(\"serial\")\npublic abstract class InternalException extends RuntimeException {\n    \/**\n     * {@inheritDoc}\n     *\/\n    public InternalException() {\n        super();\n    }\n\n    \/**\n     * {@inheritDoc}\n     *\/\n    public InternalException(String message) {\n        super(message);\n    }\n\n    \/**\n     * {@inheritDoc}\n     *\/\n    public InternalException(String message, Throwable cause) {\n        super(message, cause);\n    }\n\n    \/**\n     * {@inheritDoc}\n     *\/\n    public InternalException(Throwable cause) {\n        super(cause);\n    }\n\n    \/**\n     * {@inheritDoc}\n     *\/\n    protected InternalException(String message, Throwable cause, boolean enableSuppression,\n            boolean writableStackTrace) {\n        super(message, cause, enableSuppression, writableStackTrace);\n    }\n\n    \/**\n     * Returns a {@link ScriptException} for this exception object\n     *\/\n    public abstract ScriptException toScriptException(ExecutionContext cx);\n}\n","subject":"Remove unnecessary complete class name"}
      {"old_contents":"package com.tinkerpop.gremlin.structure;\n\nimport java.io.Serializable;\n\n\/**\n * @author Stephen Mallette (http:\/\/stephen.genoprime.com)\n *\/\npublic class MockSerializable implements Serializable {\n    private String testField;\n\n    public MockSerializable(final String testField) {\n        this.testField = testField;\n    }\n\n    public String getTestField() {\n        return this.testField;\n    }\n\n    public void setTestField(final String testField) {\n        this.testField = testField;\n    }\n\n    @Override\n    public boolean equals(Object oth) {\n        if (this == oth) return true;\n        else if (oth == null) return false;\n        else if (!getClass().isInstance(oth)) return false;\n        MockSerializable m = (MockSerializable) oth;\n        if (testField == null) {\n            return (m.testField == null);\n        } else return testField.equals(m.testField);\n    }\n}","new_contents":"package com.tinkerpop.gremlin.structure;\n\nimport java.io.Serializable;\n\n\/**\n * @author Stephen Mallette (http:\/\/stephen.genoprime.com)\n *\/\npublic class MockSerializable implements Serializable {\n    private String testField;\n\n    private MockSerializable() {}\n\n    public MockSerializable(final String testField) {\n        this.testField = testField;\n    }\n\n    public String getTestField() {\n        return this.testField;\n    }\n\n    public void setTestField(final String testField) {\n        this.testField = testField;\n    }\n\n    @Override\n    public boolean equals(Object oth) {\n        if (this == oth) return true;\n        else if (oth == null) return false;\n        else if (!getClass().isInstance(oth)) return false;\n        MockSerializable m = (MockSerializable) oth;\n        if (testField == null) {\n            return (m.testField == null);\n        } else return testField.equals(m.testField);\n    }\n}","subject":"Add private constructor to mockserializable."}
      {"old_contents":"package com.lyubenblagoev.postfixrest.configuration;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.CorsRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n@Configuration\npublic class CorsConfiguration {\n\n    @Bean\n    WebMvcConfigurer corsConfigurer() {\n        return new WebMvcConfigurer() {\n            @Override\n            public void addCorsMappings(CorsRegistry registry) {\n                registry.addMapping(\"\/api\/v1\/**\");\n            }\n        };\n    }\n}\n","new_contents":"package com.lyubenblagoev.postfixrest.configuration;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.CorsRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n@Configuration\npublic class CorsConfiguration {\n\n    @Bean\n    WebMvcConfigurer corsConfigurer() {\n        return new WebMvcConfigurer() {\n            @Override\n            public void addCorsMappings(CorsRegistry registry) {\n                registry.addMapping(\"\/api\/v1\/**\")\n                        .allowedMethods(\"*\")\n                        .allowedOrigins(\"*\");\n            }\n        };\n    }\n}\n","subject":"Improve CORS configuration to allow all methods and origins"}
      {"old_contents":"package jp.ne.opt.redshiftfake.views;\n\nimport java.sql.Connection;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\n\n\/**\n * Created by ffarrell on 14\/06\/2018.\n *\n * Some system tables that exist in redshift do not necessarily exist in postgres\n *\n * This creates pg_tableef as a view on each connection if it does not exist\n *\/\npublic class SystemViews {\n\n    private static final String createPgTableDefView =\n            \"CREATE VIEW pg_table_def (schemaname, tablename, \\\"column\\\", \\\"type\\\", \\\"encoding\\\", distkey, sortkey, \\\"notnull\\\") \" +\n                    \"AS SELECT table_schema, table_name, column_name, data_type, 'none', false, 0, CASE is_nullable WHEN 'yes' THEN false ELSE true END \" +\n                    \"FROM information_schema.columns;\";\n\n    public static void create(final Connection connection) throws SQLException {\n\n        final ResultSet resultSet = connection.createStatement().executeQuery(\"SELECT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'pg_tab_def')\");\n\n        if(resultSet.next() && !resultSet.getBoolean(1)){\n            connection.createStatement().execute(createPgTableDefView);\n        }\n    }\n\n}\n","new_contents":"package jp.ne.opt.redshiftfake.views;\n\nimport java.sql.Connection;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\n\n\/**\n * Created by frankfarrell on 14\/06\/2018.\n *\n * Some system tables that exist in redshift do not necessarily exist in postgres\n *\n * This creates pg_tableef as a view on each connection if it does not exist\n *\/\npublic class SystemViews {\n\n    private static final String pgTableDefExistsQuery = \n            \"SELECT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'pg_table_def')\";\n    private static final String createPgTableDefView =\n            \"CREATE VIEW pg_table_def (schemaname, tablename, \\\"column\\\", \\\"type\\\", \\\"encoding\\\", distkey, sortkey, \\\"notnull\\\") \" +\n                    \"AS SELECT table_schema, table_name, column_name, data_type, 'none', false, 0, CASE is_nullable WHEN 'yes' THEN false ELSE true END \" +\n                    \"FROM information_schema.columns;\";\n\n    public static void create(final Connection connection) throws SQLException {\n\n        final ResultSet resultSet = connection.createStatement().executeQuery(pgTableDefExistsQuery);\n\n        if(resultSet.next() && !resultSet.getBoolean(1)){\n            connection.createStatement().execute(createPgTableDefView);\n        }\n    }\n\n}\n","subject":"Correct typo in pg_table_def create view query"}
      {"old_contents":"package jp.ne.opt.redshiftfake.views;\n\nimport java.sql.Connection;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\n\n\/**\n * Created by ffarrell on 14\/06\/2018.\n *\n * Some system tables that exist in redshift do not necessarily exist in postgres\n *\n * This creates pg_tableef as a view on each connection if it does not exist\n *\/\npublic class SystemViews {\n\n    private static final String createPgTableDefView =\n            \"CREATE VIEW pg_table_def (schemaname, tablename, \\\"column\\\", \\\"type\\\", \\\"encoding\\\", distkey, sortkey, \\\"notnull\\\") \" +\n                    \"AS SELECT table_schema, table_name, column_name, data_type, 'none', false, 0, CASE is_nullable WHEN 'yes' THEN false ELSE true END \" +\n                    \"FROM information_schema.columns;\";\n\n    public static void create(final Connection connection) throws SQLException {\n\n        final ResultSet resultSet = connection.createStatement().executeQuery(\"SELECT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'pg_tab_def')\");\n\n        resultSet.first();\n        if(!resultSet.getBoolean(1)){\n            connection.createStatement().execute(createPgTableDefView);\n        }\n    }\n\n}\n","new_contents":"package jp.ne.opt.redshiftfake.views;\n\nimport java.sql.Connection;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\n\n\/**\n * Created by ffarrell on 14\/06\/2018.\n *\n * Some system tables that exist in redshift do not necessarily exist in postgres\n *\n * This creates pg_tableef as a view on each connection if it does not exist\n *\/\npublic class SystemViews {\n\n    private static final String createPgTableDefView =\n            \"CREATE VIEW pg_table_def (schemaname, tablename, \\\"column\\\", \\\"type\\\", \\\"encoding\\\", distkey, sortkey, \\\"notnull\\\") \" +\n                    \"AS SELECT table_schema, table_name, column_name, data_type, 'none', false, 0, CASE is_nullable WHEN 'yes' THEN false ELSE true END \" +\n                    \"FROM information_schema.columns;\";\n\n    public static void create(final Connection connection) throws SQLException {\n\n        final ResultSet resultSet = connection.createStatement().executeQuery(\"SELECT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'pg_tab_def')\");\n\n        if(resultSet.next() && !resultSet.getBoolean(1)){\n            connection.createStatement().execute(createPgTableDefView);\n        }\n    }\n\n}\n","subject":"Fix issue with FORWARD_ONLY resultSets"}
      {"old_contents":"package jkind;\n\n\npublic class JKindSettings extends Settings {\n\tpublic int n = 200;\n\tpublic int timeout = 100;\n\t\n\tpublic boolean excel = false;\n\tpublic boolean xml = false;\n\tpublic boolean xmlToStdout = false;\n\t\n\tpublic boolean boundedModelChecking = true;\n\tpublic boolean kInduction = true;\n\tpublic boolean invariantGeneration = true;\n    public int pdrMax = 1;\n\tpublic boolean inductiveCounterexamples = false;\n\tpublic boolean reduceIvc = false;\n\tpublic boolean smoothCounterexamples = false;\n    public boolean intervalGeneralization = false;\n    public boolean inline = true;\n\t\n\tpublic SolverOption solver = SolverOption.SMTINTERPOL;\n\tpublic boolean scratch = false;\n\n\tpublic String writeAdvice = null;\n\tpublic String readAdvice = null;\n}\n","new_contents":"package jkind;\n\n\npublic class JKindSettings extends Settings {\n\tpublic int n = Integer.MAX_VALUE;\n\tpublic int timeout = Integer.MAX_VALUE;\n\t\n\tpublic boolean excel = false;\n\tpublic boolean xml = false;\n\tpublic boolean xmlToStdout = false;\n\t\n\tpublic boolean boundedModelChecking = true;\n\tpublic boolean kInduction = true;\n\tpublic boolean invariantGeneration = true;\n    public int pdrMax = 1;\n\tpublic boolean inductiveCounterexamples = false;\n\tpublic boolean reduceIvc = false;\n\tpublic boolean smoothCounterexamples = false;\n    public boolean intervalGeneralization = false;\n    public boolean inline = true;\n\t\n\tpublic SolverOption solver = SolverOption.SMTINTERPOL;\n\tpublic boolean scratch = false;\n\n\tpublic String writeAdvice = null;\n\tpublic String readAdvice = null;\n}\n","subject":"Change timeout and depth to be effectively unbounded by default"}
      {"old_contents":"package rs.pelotas.tracker.core;\n\nimport java.util.logging.Logger;\nimport javax.annotation.PostConstruct;\nimport javax.inject.Inject;\nimport javax.ws.rs.ApplicationPath;\nimport rs.pelotas.arch.batch.JobScheduler;\nimport rs.pelotas.arch.core.BaseApplication;\nimport rs.pelotas.tracker.batch.PositionJob;\n\n\/**\n *\n * @author Rafael Guterres\n *\/\n@ApplicationPath(\"\/api\")\npublic class Application extends BaseApplication {\n\n    @Inject\n    JobScheduler scheduler;\n\n    @Inject\n    Logger logger;\n    \n    @Override\n    public JobScheduler getScheduler() {\n        return scheduler;\n    }\n\n    @Override\n    public Logger getLogger() {\n        return logger;\n    }\n\n    @PostConstruct\n    @Override\n    protected void init() {\n        \/\/TODO: implementar annotation para agendamento automatico\n        scheduler.addJob(new PositionJob());\n        scheduler.scheduleJobs();\n    }\n}","new_contents":"package rs.pelotas.tracker.core;\n\nimport java.util.logging.Logger;\nimport javax.annotation.PostConstruct;\nimport javax.inject.Inject;\nimport javax.ws.rs.ApplicationPath;\nimport rs.pelotas.arch.batch.JobScheduler;\nimport rs.pelotas.arch.core.BaseApplication;\nimport rs.pelotas.tracker.batch.PositionJob;\n\n\/**\n *\n * @author Rafael Guterres\n *\/\n@ApplicationPath(\"\/api\")\npublic class Application extends BaseApplication {\n\n    @Inject\n    JobScheduler scheduler;\n\n    @Inject\n    Logger logger;\n    \n    @Override\n    public JobScheduler getScheduler() {\n        return scheduler;\n    }\n\n    @Override\n    public Logger getLogger() {\n        return logger;\n    }\n\n    @PostConstruct\n    @Override\n    protected void init() {\n        \/\/TODO: implementar annotation para agendamento automatico\n        \/\/scheduler.addJob(new PositionJob());\n        \/\/scheduler.scheduleJobs();\n    }\n}","subject":"FIX to Exception in thread \"hornetq-expiry-reaper-thread\" java.lang.OutOfMemoryError: unable to create new native thread"}
      {"old_contents":"package jenkins.advancedqueue;\n\n\nimport hudson.Plugin;\nimport hudson.model.Job;\nimport hudson.model.Queue;\nimport jenkins.advancedqueue.sorter.ItemInfo;\nimport jenkins.advancedqueue.sorter.QueueItemCache;\nimport jenkins.model.Jenkins;\nimport org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution;\n\nclass PriorityConfigurationPlaceholderTaskHelper {\n\n    boolean isPlaceholderTask(Queue.Task task) {\n        return isPlaceholderTaskUsed() && task instanceof  ExecutorStepExecution.PlaceholderTask;\n    }\n\n    PriorityConfigurationCallback getPriority(ExecutorStepExecution.PlaceholderTask task, PriorityConfigurationCallback priorityCallback) {\n        Job job = (Job) task.getOwnerTask();\n        ItemInfo itemInfo = QueueItemCache.get().getItem(job.getName());\n        itemInfo.getPriority();\n        priorityCallback.setPrioritySelection(itemInfo.getPriority());\n        return priorityCallback;\n    }\n\n    static boolean isPlaceholderTaskUsed() {\n        Plugin plugin = Jenkins.getInstance().getPlugin(\"workflow-durable-task-step\");\n        return plugin != null && plugin.getWrapper().isActive();\n    }\n\n}\n","new_contents":"package jenkins.advancedqueue;\n\nimport hudson.Plugin;\nimport hudson.model.Job;\nimport hudson.model.Queue;\nimport jenkins.advancedqueue.sorter.ItemInfo;\nimport jenkins.advancedqueue.sorter.QueueItemCache;\nimport jenkins.model.Jenkins;\nimport org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution;\n\nclass PriorityConfigurationPlaceholderTaskHelper {\n\n\tboolean isPlaceholderTask(Queue.Task task) {\n\t\treturn isPlaceholderTaskUsed() && task instanceof ExecutorStepExecution.PlaceholderTask;\n\t}\n\n\tPriorityConfigurationCallback getPriority(ExecutorStepExecution.PlaceholderTask task,\n\t\t\tPriorityConfigurationCallback priorityCallback) {\n\t\tJob job = (Job) task.getOwnerTask();\n\t\tItemInfo itemInfo = QueueItemCache.get().getItem(job.getName());\n\n\t\t\/\/ Can be null if job didn't run yet\n\n\t\tif (itemInfo != null) {\n\t\t\tpriorityCallback.setPrioritySelection(itemInfo.getPriority());\n\t\t} else {\n\t\t\tpriorityCallback.setPrioritySelection(PrioritySorterConfiguration.get().getStrategy().getDefaultPriority());\n\t\t}\n\n\t\treturn priorityCallback;\n\t}\n\n\tstatic boolean isPlaceholderTaskUsed() {\n\t\tPlugin plugin = Jenkins.getInstance().getPlugin(\"workflow-durable-task-step\");\n\t\treturn plugin != null && plugin.getWrapper().isActive();\n\t}\n\n}\n","subject":"Fix upstream job priority retrieval"}
      {"old_contents":"package controllers;\n\nimport play.db.jpa.JPA;\nimport play.db.jpa.Transactional;\nimport play.mvc.Result;\n\nimport java.io.IOException;\n\nimport static play.mvc.Results.ok;\n\npublic class File {\n    @Transactional\n    public Result get(Long id) {\n        models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);\n        java.io.File file = models.FileManager.getFile(fileMeta);\n        return ok(file).as(fileMeta.getMimeType());\n    }\n\n    @Transactional\n    public Result getPreview(Long id) throws IOException {\n        models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);\n        java.io.File file = models.FileManager.getThumbnail(fileMeta);\n        return ok(file).as(fileMeta.getMimeType());\n    }\n}\n","new_contents":"package controllers;\n\nimport play.db.jpa.JPA;\nimport play.db.jpa.Transactional;\nimport play.mvc.Result;\n\nimport java.io.IOException;\n\nimport static play.mvc.Results.ok;\n\npublic class File {\n    @Transactional\n    public Result get(Long id) {\n        models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);\n        java.io.File file = models.FileManager.getFile(fileMeta);\n        return ok(file).as(fileMeta.getMimeType());\n    }\n\n    @Transactional\n    public Result getPreview(Long id) throws IOException {\n        models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);\n        java.io.File file = models.FileManager.getThumbnail(fileMeta);\n        return ok(file);\n    }\n}\n","subject":"Fix wrong Content-Type header in \/file\/min\/"}
      {"old_contents":"\/**\n * Copyright (C) 2011-2020 Red Hat, Inc. (https:\/\/github.com\/Commonjava\/indy)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *         http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\nimport javax.enterprise.context.ApplicationScoped;\nimport javax.servlet.*;\nimport javax.servlet.http.HttpServletRequest;\nimport java.io.IOException;\n\n@ApplicationScoped\npublic class SlashTolerationFilter\n        implements Filter\n{\n    @Override\n    public void init( final FilterConfig filterConfig )\n                    throws ServletException\n    {\n    }\n\n    @Override\n    public void doFilter( ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain )\n            throws IOException, ServletException\n    {\n        final HttpServletRequest hsr = (HttpServletRequest) servletRequest;\n        String newURI = hsr.getRequestURI().replaceAll( \"\/+\", \"\/\" );\n        servletRequest.getRequestDispatcher(newURI).forward(servletRequest, servletResponse);\n    }\n\n    @Override\n    public void destroy()\n    {\n    }\n\n}\n","new_contents":"\/**\n * Copyright (C) 2011-2020 Red Hat, Inc. (https:\/\/github.com\/Commonjava\/indy)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *         http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.commonjava.indy.bind.jaxrs;\n\nimport javax.enterprise.context.ApplicationScoped;\nimport javax.servlet.*;\nimport javax.servlet.http.HttpServletRequest;\nimport java.io.IOException;\n\n@ApplicationScoped\npublic class SlashTolerationFilter\n        implements Filter\n{\n    @Override\n    public void init( final FilterConfig filterConfig )\n                    throws ServletException\n    {\n    }\n\n    @Override\n    public void doFilter( ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain )\n            throws IOException, ServletException\n    {\n        final HttpServletRequest hsr = (HttpServletRequest) servletRequest;\n        String newURI = hsr.getRequestURI().replaceAll( \"\/+\", \"\/\" );\n        servletRequest.getRequestDispatcher(newURI).forward(servletRequest, servletResponse);\n    }\n\n    @Override\n    public void destroy()\n    {\n    }\n\n}\n","subject":"Fix a wrong line problem"}
      {"old_contents":"package me.eddiep.minecraft.ls.game.shop.impl;\r\n\r\nimport me.eddiep.minecraft.ls.Lavasurvival;\r\nimport me.eddiep.minecraft.ls.game.shop.Shop;\r\nimport me.eddiep.minecraft.ls.game.shop.ShopManager;\r\nimport me.eddiep.minecraft.ls.ranks.UserInfo;\r\nimport me.eddiep.minecraft.ls.ranks.UserManager;\r\nimport org.bukkit.entity.Player;\r\nimport org.bukkit.inventory.Inventory;\r\n\r\npublic class BankShopManager implements ShopManager {\r\n    @Override\r\n    public void shopClicked(Player owner, Shop shop) {\r\n        UserManager um = Lavasurvival.INSTANCE.getUserManager();\r\n\r\n        UserInfo user = um.getUser(owner.getUniqueId());\r\n\r\n        Inventory bankInventory = user.createBankInventory();\r\n\r\n        owner.openInventory(bankInventory);\r\n    }\r\n\r\n    @Override\r\n    public boolean isShopInventory(Inventory inventory, Player owner) {\r\n        return inventory.getTitle().equals(\"Bank\");\r\n    }\r\n\r\n    @Override\r\n    public void shopClosed(Player owner, Inventory inventory, Shop shop) {\r\n        if (inventory.contains(shop.getOpener())) {\r\n            inventory.remove(shop.getOpener());\r\n            inventory.setItem(inventory.firstEmpty(), shop.getOpener());\r\n        }\r\n\r\n        UserManager um = Lavasurvival.INSTANCE.getUserManager();\r\n\r\n        UserInfo user = um.getUser(owner.getUniqueId());\r\n\r\n        user.saveBank(inventory);\r\n    }\r\n}\r\n","new_contents":"package me.eddiep.minecraft.ls.game.shop.impl;\r\n\r\nimport me.eddiep.minecraft.ls.Lavasurvival;\r\nimport me.eddiep.minecraft.ls.game.shop.Shop;\r\nimport me.eddiep.minecraft.ls.game.shop.ShopManager;\r\nimport me.eddiep.minecraft.ls.ranks.UserInfo;\r\nimport me.eddiep.minecraft.ls.ranks.UserManager;\r\nimport org.bukkit.entity.Player;\r\nimport org.bukkit.inventory.Inventory;\r\n\r\npublic class BankShopManager implements ShopManager {\r\n    @Override\r\n    public void shopClicked(Player owner, Shop shop) {\r\n        UserManager um = Lavasurvival.INSTANCE.getUserManager();\r\n\r\n        UserInfo user = um.getUser(owner.getUniqueId());\r\n\r\n        Inventory bankInventory = user.createBankInventory();\r\n\r\n        owner.openInventory(bankInventory);\r\n    }\r\n\r\n    @Override\r\n    public boolean isShopInventory(Inventory inventory, Player owner) {\r\n        return inventory.getTitle().equals(\"Bank\");\r\n    }\r\n\r\n    @Override\r\n    public void shopClosed(Player owner, Inventory inventory, Shop shop) {\r\n        if (inventory.contains(shop.getOpener())) {\r\n            inventory.remove(shop.getOpener());\r\n            inventory.setItem(owner.getInventory().firstEmpty(), shop.getOpener());\r\n        }\r\n\r\n        UserManager um = Lavasurvival.INSTANCE.getUserManager();\r\n\r\n        UserInfo user = um.getUser(owner.getUniqueId());\r\n\r\n        user.saveBank(inventory);\r\n    }\r\n}\r\n","subject":"Fix being able to put bank item in bank"}
      {"old_contents":"package org.pdxfinder.rdbms.repositories;\n\nimport org.pdxfinder.rdbms.dao.MappingEntity;\nimport org.springframework.data.jpa.repository.JpaRepository;\nimport org.springframework.data.jpa.repository.Query;\nimport org.springframework.stereotype.Repository;\n\nimport java.util.List;\nimport java.util.Map;\n\n@Repository\npublic interface MappingEntityRepository extends JpaRepository {\n\n\n    MappingEntity findByMappingKey(String mappingKey);\n\n\n    List findByMappedTermLabel(String mappedTermLabel);\n}","new_contents":"package org.pdxfinder.rdbms.repositories;\n\nimport org.pdxfinder.rdbms.dao.MappingEntity;\nimport org.springframework.data.domain.Page;\nimport org.springframework.data.domain.Pageable;\nimport org.springframework.data.jpa.repository.JpaRepository;\nimport org.springframework.data.jpa.repository.Query;\nimport org.springframework.data.repository.query.Param;\nimport org.springframework.stereotype.Repository;\n\nimport java.util.List;\nimport java.util.Map;\n\n\n\/**\n * Created by abayomi on 25\/07\/2019.\n *\/\n@Repository\npublic interface MappingEntityRepository extends JpaRepository {\n\n\n    MappingEntity findByMappingKey(String mappingKey);\n\n    List findByMappedTermLabel(String mappedTermLabel);\n\n\n    @Query(value = \"Select distinct me from MappingEntity me JOIN me.mappingValues mv \" +\n            \"WHERE ((lower(me.entityType) = lower(:entityType)) OR :entityType = '') \"+\n            \"AND ((KEY(mv) = :mappingLabel AND mv = :mappingValue) OR  :mappingValue = '') \"\n    )\n    Page findByMultipleFilters(@Param(\"entityType\") String entityType,\n\n                                              @Param(\"mappingLabel\") String mappingLabel,\n                                              @Param(\"mappingValue\") String mappingValue,\n\n                                              Pageable pageable);\n\n\n\n    @Query(value = \"select me from MappingEntity me JOIN me.mappingValues mv WHERE KEY(mv) = :dataKey AND mv = :dataValue \")\n    List findByAttributeAndValue(@Param(\"dataKey\") String dataKey,\n                                                @Param(\"dataValue\") String dataValue);\n\n\n}","subject":"Create Search Filter for the Persisted Mapping Entities"}
      {"old_contents":"package org.adaptlab.chpir.android.participanttracker.validators;\n\n\/**\n * Created by mn127 on 3\/3\/15.\n *\/\npublic class CaregiverIdValidator extends ParticipantIdValidator {\n\n    @Override\n    public boolean validate(String value) {\n        if (value.length() > 0) {\n            return value.charAt(0) == 'E' && super.validate(value);\n        }\n\n        return false;\n    }\n}","new_contents":"package org.adaptlab.chpir.android.participanttracker.validators;\n\npublic class CaregiverIdValidator extends ParticipantIdValidator {\n\n    @Override\n    public boolean validate(String value) {\n        if (value.length() > 0) {\n            return value.charAt(0) == 'E' && super.validate(value);\n        }\n\n        return false;\n    }\n}","subject":"Clean up comments for caregiver id validator"}
      {"old_contents":"package tars.testutil;\n\nimport tars.model.task.*;\nimport tars.model.tag.UniqueTagList;\n\n\/**\n * A mutable task object. For testing only.\n *\/\npublic class TestTask implements ReadOnlyTask {\n\n    private Name name;\n    private UniqueTagList tags;\n    private DateTime dateTime;\n    private Status status;\n    private Priority priority;\n\n    public TestTask() {\n        tags = new UniqueTagList();\n    }\n\n    public void setName(Name name) {\n        this.name = name;\n    }\n\n    @Override\n    public Name getName() {\n        return name;\n    }\n   \n    @Override\n    public DateTime getDateTime() {\n        return dateTime;\n    }\n\n    @Override\n    public Status getStatus() {\n        return status;\n    }\n\n    @Override\n    public Priority getPriority() {\n        return priority;\n    }\n\n    @Override\n    public UniqueTagList getTags() {\n        return tags;\n    }\n\n    @Override\n    public String toString() {\n        return getAsText();\n    }\n\n    public String getAddCommand() {\n        StringBuilder sb = new StringBuilder();\n        sb.append(\"add \" + this.getName().taskName + \" \");\n        sb.append(\"-dt \" + this.getDateTime().toString() + \" \");\n        sb.append(\"-p \" + this.getPriority().toString() + \" \");\n        this.getTags().getInternalList().stream().forEach(s -> sb.append(\"t\/\" + s.tagName + \" \"));\n        return sb.toString();\n    }\n}\n","new_contents":"package tars.testutil;\n\nimport tars.model.task.*;\nimport tars.model.tag.UniqueTagList;\n\n\/**\n * A mutable task object. For testing only.\n *\/\npublic class TestTask implements ReadOnlyTask {\n\n    private Name name;\n    private UniqueTagList tags;\n    private DateTime dateTime;\n    private Status status;\n    private Priority priority;\n\n    public TestTask() {\n        tags = new UniqueTagList();\n    }\n\n    public void setName(Name name) {\n        this.name = name;\n    }\n    \n    public void setDateTime(DateTime dateTime) {\n        this.dateTime = dateTime;\n    }\n    \n   \n    public void setPriority(Priority priority) {\n        this.priority = priority;\n    }\n\n    @Override\n    public Name getName() {\n        return name;\n    }\n   \n    @Override\n    public DateTime getDateTime() {\n        return dateTime;\n    }\n\n    @Override\n    public Status getStatus() {\n        return status;\n    }\n\n    @Override\n    public Priority getPriority() {\n        return priority;\n    }\n\n    @Override\n    public UniqueTagList getTags() {\n        return tags;\n    }\n\n    @Override\n    public String toString() {\n        return getAsText();\n    }\n\n    public String getAddCommand() {\n        StringBuilder sb = new StringBuilder();\n        sb.append(\"add \" + this.getName().taskName + \" \");\n        sb.append(\"-dt \" + this.getDateTime().toString() + \" \");\n        sb.append(\"-p \" + this.getPriority().toString() + \" \");\n        this.getTags().getInternalList().stream().forEach(s -> sb.append(\"t\/\" + s.tagName + \" \"));\n        return sb.toString();\n    }\n}\n","subject":"Add setDateTime(DateTime) and setPriority(Priority) methods"}
      {"old_contents":"package org.alien4cloud.tosca.model.instances;\n\nimport com.google.common.collect.Maps;\nimport lombok.Getter;\nimport lombok.Setter;\nimport org.alien4cloud.tosca.model.CSARDependency;\nimport org.alien4cloud.tosca.model.templates.NodeTemplate;\nimport org.elasticsearch.annotation.NestedObject;\nimport org.elasticsearch.annotation.ObjectField;\nimport org.elasticsearch.annotation.StringField;\nimport org.elasticsearch.annotation.query.FetchContext;\nimport org.elasticsearch.annotation.query.TermFilter;\nimport org.elasticsearch.mapping.IndexType;\n\nimport java.util.Map;\n\nimport static alien4cloud.dao.model.FetchContext.SUMMARY;\n\n\/**\n * An instance of a node.\n *\/\n@Getter\n@Setter\npublic class NodeInstance {\n    \/\/ The node template actually does not include the type version (maybe we should add that to the node template ?).\n    @TermFilter\n    @StringField(indexType = IndexType.not_analyzed, includeInAll = false)\n    private String typeVersion;\n\n    @ObjectField\n    private NodeTemplate nodeTemplate;\n\n    @StringField(indexType = IndexType.not_analyzed, includeInAll = false)\n    private Map attributeValues = Maps.newHashMap();\n\n    public void setAttribute(String key, String value) {\n        attributeValues.put(key, value);\n    }\n}\n","new_contents":"package org.alien4cloud.tosca.model.instances;\n\nimport com.google.common.collect.Maps;\nimport lombok.Getter;\nimport lombok.Setter;\nimport org.alien4cloud.tosca.model.CSARDependency;\nimport org.alien4cloud.tosca.model.templates.NodeTemplate;\nimport org.elasticsearch.annotation.NestedObject;\nimport org.elasticsearch.annotation.ObjectField;\nimport org.elasticsearch.annotation.StringField;\nimport org.elasticsearch.annotation.query.FetchContext;\nimport org.elasticsearch.annotation.query.TermFilter;\nimport org.elasticsearch.mapping.IndexType;\n\nimport java.util.Map;\n\nimport static alien4cloud.dao.model.FetchContext.SUMMARY;\n\n\/**\n * An instance of a node.\n *\/\n@Getter\n@Setter\npublic class NodeInstance {\n    \/\/ The node template actually does not include the type version (maybe we should add that to the node template ?).\n    @TermFilter\n    @StringField(indexType = IndexType.not_analyzed, includeInAll = false)\n    private String typeVersion;\n\n    @ObjectField\n    private NodeTemplate nodeTemplate;\n\n    @ObjectField(enabled = false)\n    private Map attributeValues = Maps.newHashMap();\n\n    public void setAttribute(String key, String value) {\n        attributeValues.put(key, value);\n    }\n}\n","subject":"Correct service attributes mapping to ES"}
      {"old_contents":"package org.mozilla.mozstumbler;\n\nimport android.annotation.SuppressLint;\n\nimport java.util.Date;\nimport java.text.DateFormat;\nimport java.text.SimpleDateFormat;\nimport java.util.Locale;\nimport java.util.TimeZone;\n\npublic final class DateTimeUtils {\n    private static final DateFormat sLocaleFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);\n    private static final DateFormat sISO8601Format = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.US);\n\n    static final long MILLISECONDS_PER_DAY = 86400000;  \/\/ milliseconds\/day\n\n    static {\n        sISO8601Format.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n    }\n\n    private DateTimeUtils() {\n    }\n\n    @SuppressLint(\"SimpleDateFormat\")\n    static String formatDate(Date date) {\n        return sISO8601Format.format(date);\n    }\n\n    public static String formatTime(long time) {\n        return formatDate(new Date(time));\n    }\n\n    static String formatTimeForLocale(long time) {\n        return sLocaleFormat.format(time);\n    }\n\n    static String formatCurrentTime() {\n        return formatTimeForLocale(System.currentTimeMillis());\n    }\n}\n","new_contents":"package org.mozilla.mozstumbler;\n\nimport android.annotation.SuppressLint;\n\nimport java.util.Calendar;\nimport java.util.Date;\nimport java.text.DateFormat;\nimport java.text.SimpleDateFormat;\nimport java.util.Locale;\nimport java.util.TimeZone;\n\npublic final class DateTimeUtils {\n    private static final DateFormat sLocaleFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);\n    private static final DateFormat sISO8601Format = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.US);\n\n    static final long MILLISECONDS_PER_DAY = 86400000;  \/\/ milliseconds\/day\n\n    static {\n        sISO8601Format.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n    }\n\n    private DateTimeUtils() {\n    }\n\n    @SuppressLint(\"SimpleDateFormat\")\n    static String formatDate(Date date) {\n        Calendar c = Calendar.getInstance();\n        c.setTime(date);\n        c.set(Calendar.DAY_OF_MONTH,1);\n        date = c.getTime();\n        return sISO8601Format.format(date);\n    }\n\n    public static String formatTime(long time) {\n        return formatDate(new Date(time));\n    }\n\n    static String formatTimeForLocale(long time) {\n        return sLocaleFormat.format(time);\n    }\n\n    static String formatCurrentTime() {\n        return formatTimeForLocale(System.currentTimeMillis());\n    }\n}\n","subject":"Modify the date format to YYYY-mm-01."}
      {"old_contents":"package com.rmd.personal.projecteuler;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\npublic final class Main {\r\n\r\n    private List problemList;\r\n\r\n    private Main() {\r\n        this.problemList = new ArrayList();\r\n        this.getProblemList().add(new Problem1());\r\n    }\r\n\r\n    private List getProblemList() {\r\n        return this.problemList;\r\n    }\r\n\r\n    public static void main(String[] args) {\r\n        (new Main()).run();\r\n    }\r\n\r\n    private void run() {\r\n        for (Problem problem : this.getProblemList()) {\r\n            System.out.println(\"Problem: \" + this.getProblemList().indexOf(problem));\r\n            System.out.println(problem.getDescription());\r\n            System.out.println(problem.run());\r\n        }\r\n    }\r\n}\r\n","new_contents":"package com.rmd.personal.projecteuler;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\npublic final class Main {\r\n\r\n    private List problemList;\r\n\r\n    private Main() {\r\n        this.problemList = new ArrayList();\r\n        this.getProblemList().add(new Problem1());\r\n        this.getProblemList().add(new Problem2());\r\n        this.getProblemList().add(new Problem3());\r\n    }\r\n\r\n    private List getProblemList() {\r\n        return this.problemList;\r\n    }\r\n\r\n    public static void main(String[] args) {\r\n        (new Main()).run();\r\n    }\r\n\r\n    private void run() {\r\n        for (Problem problem : this.getProblemList()) {\r\n            System.out.println(\"Problem: \" + this.getProblemList().indexOf(problem));\r\n            System.out.println(problem.getDescription());\r\n            System.out.println(problem.run());\r\n        }\r\n    }\r\n}\r\n","subject":"Add problem 2 and 3 to main class."}
      {"old_contents":"package strings;\n\nimport org.junit.jupiter.api.Test;\n\nimport static org.junit.jupiter.api.Assertions.*;\nimport static strings.BaseConversion.baseConversion;\n\nclass BaseConversionTest {\n\n    private String expected;\n    private String input;\n    private int b1;\n    private int b2;\n\n    @Test\n    void baseConversion1() {\n        expected = \"314F\";\n        input = \"12623\";\n        b1 = 10;\n        b2 = 16;\n\n        test(expected, input, b1, b2);\n    }\n\n    @Test\n    void baseConversion2() {\n        expected = \"2C996B726\";\n        input = \"114152520463\";\n        b1 = 7;\n        b2 = 13;\n\n        test(expected, input, b1, b2);\n    }\n\n    @Test\n    void baseConversion3() {\n        expected = \"111\";\n        input = \"7\";\n        b1 = 10;\n        b2 = 2;\n\n        test(expected, input, b1, b2);\n    }\n\n    @Test\n    void baseConversion4() {\n        expected = \"33CD\";\n        input = \"10001100101001\";\n        b1 = 2;\n        b2 = 14;\n\n        test(expected, input, b1, b2);\n    }\n\n    private void test(String expected, String input, int b1, int b2) {\n        assertEquals(expected, baseConversion(input, b1, b2));\n    }\n\n\n}","new_contents":"package strings;\n\nimport org.junit.jupiter.api.Test;\n\nimport static org.junit.jupiter.api.Assertions.*;\nimport static strings.BaseConversion.baseConversion;\n\nclass BaseConversionTest {\n\n    private String expected;\n    private String input;\n    private int b1;\n    private int b2;\n\n    @Test\n    void baseConversion1() {\n        expected = \"314F\";\n        input = \"12623\";\n        b1 = 10;\n        b2 = 16;\n\n        test(expected, input, b1, b2);\n    }\n\n    @Test\n    void baseConversion2() {\n        expected = \"-6CC2\";\n        input = \"-62543\";\n        b1 = 7;\n        b2 = 13;\n\n        test(expected, input, b1, b2);\n    }\n\n    @Test\n    void baseConversion3() {\n        expected = \"111\";\n        input = \"7\";\n        b1 = 10;\n        b2 = 2;\n\n        test(expected, input, b1, b2);\n    }\n\n    @Test\n    void baseConversion4() {\n        expected = \"33CD\";\n        input = \"10001100101001\";\n        b1 = 2;\n        b2 = 14;\n\n        test(expected, input, b1, b2);\n    }\n\n    private void test(String expected, String input, int b1, int b2) {\n        assertEquals(expected, baseConversion(input, b1, b2));\n    }\n\n\n}","subject":"Remove test with integer > Integer.MAX. Replaced it with negative number test"}
      {"old_contents":"package org.bouncycastle.crypto.tls;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\n\n\/**\n * A generic interface for key exchange implementations in TLS 1.0.\n *\/\ninterface TlsKeyExchange\n{\n    static final short KE_RSA = 1;\n\/\/    static final short KE_RSA_EXPORT = 2;\n    static final short KE_DHE_DSS = 3;\n\/\/    static final short KE_DHE_DSS_EXPORT = 4;\n    static final short KE_DHE_RSA = 5;\n\/\/    static final short KE_DHE_RSA_EXPORT = 6;\n    static final short KE_DH_DSS = 7;\n    static final short KE_DH_RSA = 8;\n\/\/    static final short KE_DH_anon = 9;\n    static final short KE_SRP = 10;\n    static final short KE_SRP_DSS = 11;\n    static final short KE_SRP_RSA = 12;\n\n    void skipServerCertificate() throws IOException;\n\n    void processServerCertificate(Certificate serverCertificate) throws IOException;\n\n    void skipServerKeyExchange() throws IOException;\n\n    void processServerKeyExchange(InputStream is, SecurityParameters securityParameters)\n        throws IOException;\n\n    void generateClientKeyExchange(OutputStream os) throws IOException;\n\n    byte[] generatePremasterSecret() throws IOException;\n}\n","new_contents":"package org.bouncycastle.crypto.tls;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\n\n\/**\n * A generic interface for key exchange implementations in TLS 1.0.\n *\/\ninterface TlsKeyExchange\n{\n    static final short KE_RSA = 1;\n\/\/    static final short KE_RSA_EXPORT = 2;\n    static final short KE_DHE_DSS = 3;\n\/\/    static final short KE_DHE_DSS_EXPORT = 4;\n    static final short KE_DHE_RSA = 5;\n\/\/    static final short KE_DHE_RSA_EXPORT = 6;\n    static final short KE_DH_DSS = 7;\n    static final short KE_DH_RSA = 8;\n\/\/    static final short KE_DH_anon = 9;\n    static final short KE_SRP = 10;\n    static final short KE_SRP_DSS = 11;\n    static final short KE_SRP_RSA = 12;\n    static final short KE_ECDH_ECDSA = 13;\n    static final short KE_ECDHE_ECDSA = 14;\n    static final short KE_ECDH_RSA = 15;\n    static final short KE_ECDHE_RSA = 16;\n    static final short KE_ECDH_anon = 17;\n\n    void skipServerCertificate() throws IOException;\n\n    void processServerCertificate(Certificate serverCertificate) throws IOException;\n\n    void skipServerKeyExchange() throws IOException;\n\n    void processServerKeyExchange(InputStream is, SecurityParameters securityParameters)\n        throws IOException;\n\n    void generateClientKeyExchange(OutputStream os) throws IOException;\n\n    byte[] generatePremasterSecret() throws IOException;\n}\n","subject":"Add constants for EC key exchange methods"}
      {"old_contents":"\/*++\n\nNASM Assembly Language Plugin\nCopyright (c) 2017-2018 Aidan Khoury. All rights reserved.\n\nThis program is free software: you can redistribute it and\/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see .\n\n--*\/\n\npackage com.nasmlanguage.psi.impl;\n\nimport com.intellij.extapi.psi.ASTWrapperPsiElement;\nimport com.intellij.lang.ASTNode;\nimport com.nasmlanguage.psi.NASMNamedElement;\nimport org.jetbrains.annotations.NotNull;\n\npublic abstract class NASMNamedElementImpl extends ASTWrapperPsiElement implements NASMNamedElement {\n    public NASMNamedElementImpl(@NotNull ASTNode node) {\n        super(node);\n    }\n}\n","new_contents":"\/*++\n\nNASM Assembly Language Plugin\nCopyright (c) 2017-2018 Aidan Khoury\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n--*\/\n\npackage com.nasmlanguage.psi.impl;\n\nimport com.intellij.extapi.psi.ASTWrapperPsiElement;\nimport com.intellij.lang.ASTNode;\nimport com.nasmlanguage.psi.NASMNamedElement;\nimport org.jetbrains.annotations.NotNull;\n\npublic abstract class NASMNamedElementImpl extends ASTWrapperPsiElement implements NASMNamedElement {\n    public NASMNamedElementImpl(@NotNull ASTNode node) {\n        super(node);\n    }\n}\n","subject":"Update copyright notice with MIT license"}
      {"old_contents":"package main.java.player;\n\nimport jgame.platform.JGEngine;\n\npublic class TDPlayerEngine extends JGEngine {\n\t\n\tpublic TDPlayerEngine() {\n\t\tsuper();\n\t\tinitEngineComponent(960, 640);\n\t}\n\t\n\t@Override\n\tpublic void initCanvas() {\n\t\tsetCanvasSettings(15, 10, 32, 32, null, null, null);\n\t}\n\n\t@Override\n\tpublic void initGame() {\n\t\tsetFrameRate(35, 2);\n\t}\n\n\tpublic void doFrame() {\n\t\t\n\t}\n}\n","new_contents":"package main.java.player;\n\nimport jgame.JGColor;\nimport jgame.JGPoint;\nimport jgame.platform.JGEngine;\nimport main.java.engine.Model;\n\npublic class TDPlayerEngine extends JGEngine {\n    private Model model;\n\t\n\tpublic TDPlayerEngine() {\n\t\tsuper();\n\t\tinitEngineComponent(960, 640);\n\t}\n\t\n\t@Override\n\tpublic void initCanvas() {\n\t\tsetCanvasSettings(15, 10, 32, 32, null, JGColor.black, null);\n\t}\n\n\t@Override\n\tpublic void initGame() {\n\t\tsetFrameRate(45, 1);\n        this.model = new Model();\n        model.setEngine(this);\n        model.addNewPlayer();\n        model.loadMap(\"testmap.json\");\n        defineMedia(\"\/main\/resources\/media.tbl\");\n        model.setTemporaryWaveSchema();\n\t}\n\t\n    @Override\n    public void paintFrame() {\n        highlightMouseoverTile();\n        displayGameStats();\n    }\n\n    private void highlightMouseoverTile() {\n        JGPoint mousePos = getMousePos();\n        int curXTilePos = mousePos.x\/tileWidth() * tileWidth();\n        int curYTilePos = mousePos.y\/tileHeight() * tileHeight();\n\n        this.drawRect(curXTilePos, curYTilePos, tileWidth(), tileHeight(), false, false, 1.0, JGColor.yellow);\n    }\n    \n    private void displayGameStats() {\n    \tthis.drawString(\"Score: \"+model.getScore(), 50, 25, -1);\n    \tthis.drawString(\"Lives left: \"+model.getPlayerLife(), 50, 50, -1);\n    \tthis.drawString(\"Money: \"+model.getMoney(), 50, 75, -1);\n    \tthis.drawString(\"Game clock: \"+model.getGameClock(), 50, 100, -1);\n    }\n\n    @Override\n    public void doFrame() {\n        super.doFrame();\n        model.updateGameClockByFrame();\n        if (getMouseButton(1)) {\n            model.placeTower(getMouseX(), getMouseY());\n        }\n        if (model.getGameClock() % 100 == 0)\n        \tmodel.spawnNextWave();\n        moveObjects();\n\/\/        model.spawnMonster(100, 150);\n    }\n}\n","subject":"Make player talk to engine"}
      {"old_contents":"package peergos.shared.storage;\n\nimport peergos.shared.crypto.hash.*;\n\nimport java.util.concurrent.*;\nimport java.util.function.*;\n\npublic class Transaction {\n\n    \/** Run a series of operations under a transaction, ensuring that it is closed correctly\n     *\n     * @param owner\n     * @param processor\n     * @param ipfs\n     * @param \n     * @return\n     *\/\n    public static  CompletableFuture run(PublicKeyHash owner,\n                                               Function> processor,\n                                               ContentAddressedStorage ipfs) {\n        CompletableFuture res = new CompletableFuture<>();\n        ipfs.startTransaction(owner).thenCompose(tid -> processor.apply(tid)\n                .thenCompose(v -> ipfs.closeTransaction(owner, tid)\n                        .thenApply(x -> res.complete(v)))\n                .exceptionally(t -> {\n                    ipfs.closeTransaction(owner, tid)\n                            .thenApply(x -> res.completeExceptionally(t))\n                            .exceptionally(e -> res.completeExceptionally(e));\n                    return false;\n                }));\n        return res;\n    }\n}\n","new_contents":"package peergos.shared.storage;\n\nimport peergos.shared.crypto.hash.*;\n\nimport java.util.concurrent.*;\nimport java.util.function.*;\n\npublic class Transaction {\n\n    \/** Run a series of operations under a transaction, ensuring that it is closed correctly\n     *\n     * @param owner\n     * @param processor\n     * @param ipfs\n     * @param \n     * @return\n     *\/\n    public static  CompletableFuture run(PublicKeyHash owner,\n                                               Function> processor,\n                                               ContentAddressedStorage ipfs) {\n        CompletableFuture res = new CompletableFuture<>();\n        ipfs.startTransaction(owner).thenCompose(tid -> processor.apply(tid)\n                .thenCompose(v -> ipfs.closeTransaction(owner, tid)\n                        .thenApply(x -> res.complete(v)))\n                .exceptionally(t -> {\n                    ipfs.closeTransaction(owner, tid)\n                            .thenApply(x -> res.completeExceptionally(t))\n                            .exceptionally(e -> res.completeExceptionally(e));\n                    return false;\n                })).exceptionally(e -> res.completeExceptionally(e));\n        return res;\n    }\n}\n","subject":"Make sure a transaction completes exceptionally if it fails to start"}
      {"old_contents":"package com.meedan;\n\nimport android.app.Activity;\n\nimport java.util.*;\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\n\nimport com.meedan.ShareMenuModule;\n\npublic class ShareMenuPackage implements ReactPackage {\n\n  public ShareMenuPackage() {\n    super();\n  }\n\n  @Override\n  public List createNativeModules(ReactApplicationContext reactContext) {\n    List modules = new ArrayList<>();\n    modules.add(new ShareMenuModule(reactContext));\n    return modules;\n  }\n\n  @Override\n  public List> createJSModules() {\n    return Collections.emptyList();\n  }\n\n  @Override\n  public List createViewManagers(ReactApplicationContext reactContext) {\n    return Collections.emptyList();\n  }\n}\n","new_contents":"package com.meedan;\n\nimport android.app.Activity;\n\nimport java.util.*;\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\n\nimport com.meedan.ShareMenuModule;\n\npublic class ShareMenuPackage implements ReactPackage {\n\n  public ShareMenuPackage() {\n    super();\n  }\n\n  @Override\n  public List createNativeModules(ReactApplicationContext reactContext) {\n    List modules = new ArrayList<>();\n    modules.add(new ShareMenuModule(reactContext));\n    return modules;\n  }\n\n  @Override\n  public List createViewManagers(ReactApplicationContext reactContext) {\n    return Collections.emptyList();\n  }\n}\n","subject":"Fix Compilation Error in React Native 0.47.0"}
      {"old_contents":"package com.github.ferstl.depgraph;\n\nimport java.io.File;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport io.takari.maven.testing.TestResources;\nimport io.takari.maven.testing.executor.MavenExecutionResult;\nimport io.takari.maven.testing.executor.MavenRuntime;\nimport io.takari.maven.testing.executor.MavenRuntime.MavenRuntimeBuilder;\nimport io.takari.maven.testing.executor.MavenVersions;\nimport io.takari.maven.testing.executor.junit.MavenJUnitTestRunner;\n\n@RunWith(MavenJUnitTestRunner.class)\n@MavenVersions(\"3.3.9\")\npublic class IntegrationTest {\n\n  @Rule\n  public final TestResources resources = new TestResources();\n\n  private final MavenRuntime mavenRuntime;\n\n  public IntegrationTest(MavenRuntimeBuilder builder) throws Exception {\n    this.mavenRuntime = builder.build();\n  }\n\n  @Test\n  public void graph() throws Exception {\n    File basedir = this.resources.getBasedir(\"depgraph-maven-plugin-test\");\n    MavenExecutionResult result = this.mavenRuntime\n        .forProject(basedir)\n        .execute(\"clean\", \"depgraph:graph\");\n\n    result.assertErrorFreeLog();\n  }\n}\n","new_contents":"package com.github.ferstl.depgraph;\n\nimport java.io.File;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport io.takari.maven.testing.TestResources;\nimport io.takari.maven.testing.executor.MavenExecutionResult;\nimport io.takari.maven.testing.executor.MavenRuntime;\nimport io.takari.maven.testing.executor.MavenRuntime.MavenRuntimeBuilder;\nimport io.takari.maven.testing.executor.MavenVersions;\nimport io.takari.maven.testing.executor.junit.MavenJUnitTestRunner;\nimport static io.takari.maven.testing.TestResources.assertFilesPresent;\n\n@RunWith(MavenJUnitTestRunner.class)\n@MavenVersions(\"3.3.9\")\npublic class IntegrationTest {\n\n  @Rule\n  public final TestResources resources = new TestResources();\n\n  private final MavenRuntime mavenRuntime;\n\n  public IntegrationTest(MavenRuntimeBuilder builder) throws Exception {\n    this.mavenRuntime = builder.build();\n  }\n\n  @Test\n  public void graph() throws Exception {\n    File basedir = this.resources.getBasedir(\"depgraph-maven-plugin-test\");\n    MavenExecutionResult result = this.mavenRuntime\n        .forProject(basedir)\n        .execute(\"clean\", \"depgraph:graph\");\n\n    result.assertErrorFreeLog();\n    assertFilesPresent(\n        basedir,\n        \"module-1\/target\/dependency-graph.dot\",\n        \"module-2\/target\/dependency-graph.dot\",\n        \"sub-parent\/module-3\/target\/dependency-graph.dot\");\n  }\n}\n","subject":"Add assertion for dot files"}
      {"old_contents":"package endtoend;\n\nimport static org.junit.Assert.assertEquals;\nimport me.moodcat.api.models.RoomModel;\nimport me.moodcat.api.models.SongModel;\n\nimport org.junit.Test;\n\npublic class ApiEndToEndTest extends EndToEndTest {\n\n    @Test\n    public void canRetrieveRooms() {\n        RoomModel room = this.performGETRequest(RoomModel.class, \"rooms\/1\");\n        \n        assertEquals(1, room.getId().intValue());\n        assertEquals(1, room.getNowPlaying().getSong().getId().intValue());\n    }\n    \n    @Test\n    public void canRetrieveSongs() {\n        SongModel song = this.performGETRequest(SongModel.class, \"songs\/1\");\n        \n        assertEquals(1, song.getId().intValue());\n        assertEquals(202330997, song.getSoundCloudId().intValue());\n    }\n\n}\n","new_contents":"package endtoend;\n\nimport static org.junit.Assert.assertEquals;\n\nimport java.util.List;\n\nimport javax.ws.rs.core.GenericType;\n\nimport me.moodcat.api.models.RoomModel;\nimport me.moodcat.api.models.SongModel;\n\nimport org.junit.Test;\n\npublic class ApiEndToEndTest extends EndToEndTest {\n\n    @Test\n    public void canRetrieveRoom() {\n        RoomModel room = this.performGETRequest(RoomModel.class, \"rooms\/1\");\n        \n        assertEquals(1, room.getId().intValue());\n        assertEquals(1, room.getNowPlaying().getSong().getId().intValue());\n    }\n    \n    @Test\n    public void canRetrieveSongs() {\n        SongModel song = this.performGETRequest(SongModel.class, \"songs\/1\");\n        \n        assertEquals(1, song.getId().intValue());\n        assertEquals(202330997, song.getSoundCloudId().intValue());\n    }\n    \n    @Test\n    public void canRetrieveRooms() {\n        List rooms = this.performGETRequestWithGenericType(new GenericType>(){}, \"rooms\");\n        \n        assertEquals(1, rooms.get(0).getId().intValue());\n    }\n\n}\n","subject":"Test that might be failing. Let's see."}
      {"old_contents":"package de.stefanhoth.android.got2048.logic;\n\nimport de.stefanhoth.android.got2048.logic.model.Cell;\nimport de.stefanhoth.android.got2048.logic.model.Grid;\nimport de.stefanhoth.android.got2048.logic.model.MOVE_DIRECTION;\n\n\/**\n * TODO describe class\n *\n * @author Stefan Hoth \n *         date: 20.03.14 20:40\n * @since TODO add version\n *\/\npublic class MCP {\n\n    protected static final int DEFAULT_START_FIELDS = 2;\n    protected static final int DEFAULT_START_VALUE = 2;\n    private Grid playlingField;\n\n    public MCP() {\n\n        playlingField = new Grid();\n    }\n\n    protected Grid getPlaylingField() {\n        return playlingField;\n    }\n\n    public void addStartCells() {\n\n        Cell cell = playlingField.getRandomCell();\n\n        cell.setValue(DEFAULT_START_VALUE);\n\n        Cell nextCell = playlingField.getRandomCell();\n\n        for (int count = playlingField.getActiveCells(); count < DEFAULT_START_FIELDS; count++) {\n            while (cell.equals(nextCell)) {\n                nextCell = playlingField.getRandomCell();\n            }\n\n            nextCell.setValue(DEFAULT_START_VALUE);\n            cell = nextCell;\n        }\n    }\n\n    public void move(MOVE_DIRECTION direction) {\n\n        \/\/left to right\n        playlingField.moveCells();\n\n    }\n}\n","new_contents":"package de.stefanhoth.android.got2048.logic;\n\nimport de.stefanhoth.android.got2048.logic.model.Cell;\nimport de.stefanhoth.android.got2048.logic.model.Grid;\nimport de.stefanhoth.android.got2048.logic.model.MOVE_DIRECTION;\n\n\/**\n * TODO describe class\n *\n * @author Stefan Hoth \n *         date: 20.03.14 20:40\n * @since TODO add version\n *\/\npublic class MCP {\n\n    protected static final int DEFAULT_START_FIELDS = 2;\n    protected static final int DEFAULT_START_VALUE = 2;\n    private Grid playlingField;\n\n    public MCP() {\n        playlingField = new Grid();\n    }\n\n    public MCP(int gridSize) {\n        playlingField = new Grid(gridSize);\n    }\n\n    protected Grid getPlaylingField() {\n        return playlingField;\n    }\n\n    public void addStartCells() {\n\n        Cell cell = playlingField.getRandomCell();\n\n        cell.setValue(DEFAULT_START_VALUE);\n\n        Cell nextCell = playlingField.getRandomCell();\n\n        for (int count = playlingField.getActiveCells(); count < DEFAULT_START_FIELDS; count++) {\n            while (cell.equals(nextCell)) {\n                nextCell = playlingField.getRandomCell();\n            }\n\n            nextCell.setValue(DEFAULT_START_VALUE);\n            cell = nextCell;\n        }\n    }\n\n    public void move(MOVE_DIRECTION direction) {\n\n        \/\/left to right\n        playlingField.moveCells();\n\n    }\n}\n","subject":"Enable customization of gridSize during instance creation"}
      {"old_contents":"package info.u_team.u_team_test.init;\n\nimport net.minecraftforge.client.event.ColorHandlerEvent;\nimport net.minecraftforge.client.event.RenderTooltipEvent.Color;\nimport net.minecraftforge.eventbus.api.IEventBus;\n\npublic class TestColors {\n\t\n\tprivate static void colorItem(ColorHandlerEvent.Item event) {\n\t\t\/\/ This use the awt color class. Might not work but was too lazy to write an own color class.\n\t\tevent.getItemColors().register((stack, index) -> Color.getHSBColor((float) stack.getDamageValue() \/ (float) stack.getMaxDamage(), 0.8F, 0.5F).getRGB(), TestItems.BASIC.get());\n\t}\n\t\n\tpublic static void registerMod(IEventBus bus) {\n\t\tbus.addListener(TestColors::colorItem);\n\t}\n}\n","new_contents":"package info.u_team.u_team_test.init;\n\nimport java.awt.Color;\n\nimport net.minecraftforge.client.event.ColorHandlerEvent;\nimport net.minecraftforge.eventbus.api.IEventBus;\n\npublic class TestColors {\n\t\n\tprivate static void colorItem(ColorHandlerEvent.Item event) {\n\t\t\/\/ This use the awt color class. Might not work but was too lazy to write an own color class.\n\t\tevent.getItemColors().register((stack, index) -> Color.getHSBColor((float) stack.getDamageValue() \/ (float) stack.getMaxDamage(), 0.8F, 0.5F).getRGB(), TestItems.BASIC.get());\n\t}\n\t\n\tpublic static void registerMod(IEventBus bus) {\n\t\tbus.addListener(TestColors::colorItem);\n\t}\n}\n","subject":"Fix test mod, compiles now :)"}
      {"old_contents":"package fr.jmini.htmlchecker.settings;\n\nimport java.io.File;\n\nimport com.selesse.jxlint.settings.ProgramSettings;\n\npublic class HtmlCheckerProgramSettings implements ProgramSettings {\n  @Override\n  public String getProgramVersion() {\n    return \"1.2.2\";\n  }\n\n  @Override\n  public String getProgramName() {\n    return \"htmlchecker\";\n  }\n\n  @Override\n  public void initializeForWeb(File projectRoot) {\n  }\n}\n","new_contents":"package fr.jmini.htmlchecker.settings;\n\nimport java.io.File;\n\nimport com.selesse.jxlint.settings.ProgramSettings;\n\npublic class HtmlCheckerProgramSettings implements ProgramSettings {\n  @Override\n  public String getProgramVersion() {\n    return \"1.2.3\";\n  }\n\n  @Override\n  public String getProgramName() {\n    return \"htmlchecker\";\n  }\n\n  @Override\n  public void initializeForWeb(File projectRoot) {\n  }\n}\n","subject":"Fix test after version bump"}
      {"old_contents":"package org.apache.ddlutils.platform;\n\n\/*\n * Copyright 1999-2005 The Apache Software Foundation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\nimport java.io.IOException;\n\nimport org.apache.ddlutils.PlatformInfo;\nimport org.apache.ddlutils.model.Table;\n\n\/**\n * The SQL Builder for the HsqlDb database.\n * \n * @author James Strachan\n * @author Thomas Dudziak\n * @version $Revision$\n *\/\npublic class HsqlDbBuilder extends SqlBuilder\n{\n    \/**\n     * Creates a new builder instance.\n     * \n     * @param info The platform info\n     *\/\n    public HsqlDbBuilder(PlatformInfo info)\n    {\n        super(info);\n    }\n\n    \/**\n     * {@inheritDoc}\n     *\/\n    public void dropTable(Table table) throws IOException\n    { \n        print(\"DROP TABLE \");\n        printIdentifier(getTableName(table));\n        print(\" IF EXISTS\");\n        printEndOfStatement();\n    }\n}\n","new_contents":"package org.apache.ddlutils.platform;\n\n\/*\n * Copyright 1999-2005 The Apache Software Foundation.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\nimport java.io.IOException;\n\nimport org.apache.ddlutils.PlatformInfo;\nimport org.apache.ddlutils.model.Table;\n\n\/**\n * The SQL Builder for the HsqlDb database.\n * \n * @author James Strachan\n * @author Thomas Dudziak\n * @version $Revision$\n *\/\npublic class HsqlDbBuilder extends SqlBuilder\n{\n    \/**\n     * Creates a new builder instance.\n     * \n     * @param info The platform info\n     *\/\n    public HsqlDbBuilder(PlatformInfo info)\n    {\n        super(info);\n    }\n\n    \/**\n     * {@inheritDoc}\n     *\/\n    public void dropTable(Table table) throws IOException\n    { \n        print(\"DROP TABLE \");\n        printIdentifier(getTableName(table));\n        print(\" IF EXISTS\");\n        printEndOfStatement();\n    }\n\n    \/**\n     * @see org.apache.ddlutils.platform.SqlBuilder#getSelectLastInsertId(org.apache.ddlutils.model.Table)\n     *\/\n    public String getSelectLastInsertId(Table table) \n    {\n        return \"CALL IDENTITY()\";\n    }\n    \n    \n}\n","subject":"Add call identity to hsqldb."}
      {"old_contents":"package com.nickww.finitefield;\r\n\r\npublic abstract class ChecksumVector\r\n{\r\n\t\/**\r\n\t * Calculates checksums for the given data, and returns a vector which is the given data bytes followed by the\r\n\t * checksum bytes.\r\n\t * \r\n\t * @param data The data to checksum.\r\n\t * @return An array with the data and the checksums.\r\n\t *\/\r\n\tpublic abstract byte[] withChecksums(byte[] data);\r\n\t\r\n\t\/**\r\n\t * Calculates the data bytes from the given array. The array must represent the data bytes, in order, followed by\r\n\t * the checksum bytes, in order. Values which are missing (to be solved for) should be present as a\r\n\t * null<\/code>.\r\n\t * \r\n\t * @param dataWithChecksums The data, followed by the checksums, with nulls for unknown values.\r\n\t * @return An array with the original data bytes (no checksums).\r\n\t * @throws IllegalArgumentException if the given byte array has too many missing values (nulls) to recalculate the\r\n\t * original data, or if the array is not large enough to be valid.\r\n\t *\/\r\n\tpublic abstract byte[] solveMissingValues(Byte[] dataWithChecksums);\r\n}\r\n","new_contents":"package com.nickww.finitefield;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\npublic abstract class ChecksumVector\r\n{\r\n\t\/**\r\n\t * Calculates checksums for the given data, and returns a vector which is the given data bytes followed by the\r\n\t * checksum bytes.\r\n\t * \r\n\t * @param data The data to checksum.\r\n\t * @return An array with the data and the checksums.\r\n\t *\/\r\n\tpublic abstract byte[] withChecksums(byte[] data);\r\n\t\r\n\t\/**\r\n\t * Calculates the data bytes from the given array. The array must represent the data bytes, in order, followed by\r\n\t * the checksum bytes, in order. Values which are missing (to be solved for) should be present as a\r\n\t * null<\/code>.\r\n\t * \r\n\t * @param dataWithChecksums The data, followed by the checksums, with nulls for unknown values.\r\n\t * @return An array with the original data bytes (no checksums).\r\n\t * @throws IllegalArgumentException if the given byte array has too many missing values (nulls) to recalculate the\r\n\t * original data, or if the array is not large enough to be valid.\r\n\t *\/\r\n\tpublic abstract byte[] solveMissingValues(Byte[] dataWithChecksums);\r\n\t\r\n\t\/**\r\n\t * Returns a list of the indices of the given array whose values are null. If the given array is null, null is\r\n\t * returned.\r\n\t * \r\n\t * @param array The array in which to check for nulls.\r\n\t * @return The indices of the given array which are null, sorted in ascending order, or null.\r\n\t *\/\r\n\tprotected List missingIndices(Byte[] array)\r\n\t{\r\n\t\tif(array == null)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\tList nulls = new ArrayList<>();\r\n\t\tfor(int index = 0; index < array.length; index++)\r\n\t\t\tnulls.add(index);\r\n\t\treturn nulls;\r\n\t}\r\n}\r\n","subject":"Create convenience method to determine the indices of null in an array"}
      {"old_contents":"package me.mrten.mysqlapi;\n\npublic class MySQL {\n\n    private ConnectionManager connectionManager;\n\n    public MySQL() {\n\n    }\n\n    \/**\n     * Get the connection manager.\n     *\n     * @return the connection manager\n     *\/\n    public ConnectionManager getConnectionManager() {\n        return connectionManager;\n    }\n\n    \/**\n     * Connect to a MySQL database.\n     * @param host - the host for connecting to the database\n     * @param port - the port (by default 3306)\n     * @param username - username used to connect to the database\n     * @param password - password used to connect to the database\n     * @param database - name of the database to connect to\n     *\/\n    public void connect(String host, String port, String username, String password, String database) {\n        connectionManager = new ConnectionManager(host, port, username, password, database);\n    }\n\n    \/**\n     * Close all connections and the data source.\n     *\/\n    public void disconnect() {\n        if (connectionManager != null)\n            connectionManager.close();\n    }\n}\n","new_contents":"package me.mrten.mysqlapi;\n\npublic class MySQL {\n\n    private ConnectionManager connectionManager;\n\n    public MySQL() {\n\n    }\n\n    \/**\n     * Get the connection manager.\n     *\n     * @return the connection manager\n     *\/\n    public ConnectionManager getConnectionManager() {\n        return connectionManager;\n    }\n\n    \/**\n     * Connect to a MySQL database.\n     * @param host - the host for connecting to the database\n     * @param port - the port (by default 3306)\n     * @param username - username used to connect to the database\n     * @param password - password used to connect to the database\n     * @param database - name of the database to connect to\n     *\/\n    public void connect(String host, String port, String username, String password, String database) {\n        connectionManager = new ConnectionManager(host, port, username, password, database);\n        connectionManager.open();\n    }\n\n    \/**\n     * Close all connections and the data source.\n     *\/\n    public void disconnect() {\n        if (connectionManager != null)\n            connectionManager.close();\n    }\n}\n","subject":"Fix connection manager not opening connection"}
      {"old_contents":"\/*\n * DatasourceConfig.java\n *\n * Copyright (C) 2017 [ A Legge Up ]\n *\n * This software may be modified and distributed under the terms\n * of the MIT license.  See the LICENSE file for details.\n *\/\n\npackage com.aleggeup.confagrid.config;\n\nimport javax.sql.DataSource;\n\nimport org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.jdbc.datasource.DriverManagerDataSource;\n\n@Configuration\npublic class DatasourceConfig {\n\n    @Bean\n    DataSource datasource(final DataSourceProperties datasourceProperties) {\n        final DriverManagerDataSource dataSource = new DriverManagerDataSource();\n        dataSource.setDriverClassName(datasourceProperties.getDriverClassName());\n        dataSource.setUsername(datasourceProperties.getUsername());\n        dataSource.setPassword(datasourceProperties.getPassword());\n        dataSource.setUrl(datasourceProperties.getUrl());\n\n        return dataSource;\n    }\n}\n","new_contents":"\/*\n * DatasourceConfig.java\n *\n * Copyright (C) 2017 [ A Legge Up ]\n *\n * This software may be modified and distributed under the terms\n * of the MIT license.  See the LICENSE file for details.\n *\/\n\npackage com.aleggeup.confagrid.config;\n\nimport javax.sql.DataSource;\n\nimport org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Primary;\nimport org.springframework.jdbc.datasource.DriverManagerDataSource;\n\n@Configuration\npublic class DatasourceConfig {\n\n    @Bean\n    @Primary\n    DataSource datasource(final DataSourceProperties datasourceProperties) {\n        final DriverManagerDataSource dataSource = new DriverManagerDataSource();\n        dataSource.setDriverClassName(datasourceProperties.getDriverClassName());\n        dataSource.setUsername(datasourceProperties.getUsername());\n        dataSource.setPassword(datasourceProperties.getPassword());\n        dataSource.setUrl(datasourceProperties.getUrl());\n\n        return dataSource;\n    }\n}\n","subject":"Add 'Primary' annotation so that it is clear for AutoWired"}
      {"old_contents":"package org.orienteer.core.widget.command;\n\nimport java.util.Optional;\n\nimport org.apache.wicket.ajax.AjaxRequestTarget;\nimport org.apache.wicket.model.IModel;\nimport org.orienteer.core.component.BootstrapSize;\nimport org.orienteer.core.component.BootstrapType;\nimport org.orienteer.core.component.FAIconType;\nimport org.orienteer.core.component.command.AjaxCommand;\nimport org.orienteer.core.component.property.DisplayMode;\nimport org.orienteer.core.widget.DashboardPanel;\nimport org.orienteer.core.widget.IDashboardContainer;\n\nimport com.orientechnologies.orient.core.record.impl.ODocument;\n\n\/**\n * Command to save silently current dashboard\n *\/\npublic class SilentSaveDashboardCommand extends AjaxCommand {\n\tprivate static final long serialVersionUID = 1L;\n\n\tpublic SilentSaveDashboardCommand(String id, IModel dashboardDocumentModel) {\n\t\tsuper(id, \"command.save\", dashboardDocumentModel);\n\t\tsetIcon(FAIconType.save);\n\t\tsetChangingDisplayMode(true);\n\t}\n\t\n\t@Override\n\tpublic void onClick(Optional targetOptional) {\n\t\tIDashboardContainer container = findParent(IDashboardContainer.class);\n\t\tDashboardPanel dashboard = container.getCurrentDashboard().getSelfComponent();\n\t\tdashboard.storeDashboard();\n\t\tdashboard.getModeModel().setObject(DisplayMode.VIEW);\n\t\ttargetOptional.ifPresent(target -> target.add(dashboard));\n\t}\n}\n","new_contents":"package org.orienteer.core.widget.command;\n\nimport com.orientechnologies.orient.core.record.impl.ODocument;\nimport org.apache.wicket.ajax.AjaxRequestTarget;\nimport org.apache.wicket.model.IModel;\nimport org.orienteer.core.component.FAIconType;\nimport org.orienteer.core.component.command.AjaxCommand;\nimport org.orienteer.core.component.property.DisplayMode;\nimport org.orienteer.core.widget.DashboardPanel;\nimport org.orienteer.core.widget.IDashboardContainer;\n\nimport java.util.Optional;\n\n\/**\n * Command to save silently current dashboard\n *\/\npublic class SilentSaveDashboardCommand extends AjaxCommand {\n\tprivate static final long serialVersionUID = 1L;\n\n\tpublic SilentSaveDashboardCommand(String id, IModel dashboardDocumentModel) {\n\t\tsuper(id, \"command.save\", dashboardDocumentModel);\n\t\tsetIcon(FAIconType.save);\n\t\tsetChangingDisplayMode(true);\n\t}\n\t\n\t@Override\n\tpublic void onClick(Optional targetOptional) {\n\t\tIDashboardContainer container = findParent(IDashboardContainer.class);\n\t\tDashboardPanel dashboard = container.getCurrentDashboard().getSelfComponent();\n\t\tdashboard.storeDashboard();\n\t\tdashboard.getModeModel().setObject(DisplayMode.VIEW);\n\t\ttargetOptional.ifPresent(target -> {\n\t\t\ttarget.add(container.getSelf().get(\"pageHeader\"));\n\t\t\ttarget.add(dashboard);\n\t\t});\n\t}\n}\n","subject":"Update page header on click"}
      {"old_contents":"package org.realityforge.arez.api2;\n\nimport java.util.function.Supplier;\nimport javax.annotation.Nonnull;\n\nfinal class Guards\n{\n  private Guards()\n  {\n  }\n\n  \/**\n   * Check an invariant in code base.\n   * If the condition is false then an {@link IllegalStateException} is thrown.\n   * The invariant check will be skipped unless the configuration setting {@link ArezConfig#checkInvariants()}\n   * is true. A null message is used rather than supplied message unless {@link ArezConfig#verboseErrorMessages()}\n   * is true.\n   *\n   * @throws IllegalStateException if condition returns false.\n   *\/\n  static void invariant( @Nonnull final Supplier condition,\n                         @Nonnull final Supplier message )\n  {\n    if ( ArezConfig.checkInvariants() && !condition.get() )\n    {\n      fail( message );\n    }\n  }\n\n  \/**\n   * Throw an IllegalStateException with supplied detail message.\n   * The exception is not thrown unless {@link ArezConfig#checkInvariants()} is true.\n   * The exception will ignore the supplied message unless {@link ArezConfig#verboseErrorMessages()} is true.\n   *\/\n  static void fail( @Nonnull final Supplier message )\n  {\n    if ( ArezConfig.checkInvariants() )\n    {\n      if ( ArezConfig.verboseErrorMessages() )\n      {\n        throw new IllegalStateException( ArezUtil.safeGetString( message ) );\n      }\n      else\n      {\n        throw new IllegalStateException();\n      }\n    }\n  }\n}\n","new_contents":"package org.realityforge.arez.api2;\n\nimport java.util.function.Supplier;\nimport javax.annotation.Nonnull;\nimport org.jetbrains.annotations.Contract;\n\nfinal class Guards\n{\n  private Guards()\n  {\n  }\n\n  \/**\n   * Check an invariant in code base.\n   * If the condition is false then an {@link IllegalStateException} is thrown.\n   * The invariant check will be skipped unless the configuration setting {@link ArezConfig#checkInvariants()}\n   * is true. A null message is used rather than supplied message unless {@link ArezConfig#verboseErrorMessages()}\n   * is true.\n   *\n   * @throws IllegalStateException if condition returns false.\n   *\/\n  static void invariant( @Nonnull final Supplier condition,\n                         @Nonnull final Supplier message )\n  {\n    if ( ArezConfig.checkInvariants() && !condition.get() )\n    {\n      fail( message );\n    }\n  }\n\n  \/**\n   * Throw an IllegalStateException with supplied detail message.\n   * The exception is not thrown unless {@link ArezConfig#checkInvariants()} is true.\n   * The exception will ignore the supplied message unless {@link ArezConfig#verboseErrorMessages()} is true.\n   *\/\n  @Contract( \"_ -> fail\" )\n  static void fail( @Nonnull final Supplier message )\n  {\n    if ( ArezConfig.checkInvariants() )\n    {\n      if ( ArezConfig.verboseErrorMessages() )\n      {\n        throw new IllegalStateException( ArezUtil.safeGetString( message ) );\n      }\n      else\n      {\n        throw new IllegalStateException();\n      }\n    }\n  }\n}\n","subject":"Add Contract annotation to help idea perform flow analysis"}
      {"old_contents":"package editor.util;\n\nimport java.awt.Color;\nimport java.lang.reflect.Type;\n\nimport com.google.gson.JsonDeserializationContext;\nimport com.google.gson.JsonDeserializer;\nimport com.google.gson.JsonElement;\nimport com.google.gson.JsonParseException;\nimport com.google.gson.JsonPrimitive;\nimport com.google.gson.JsonSerializationContext;\nimport com.google.gson.JsonSerializer;\n\npublic class ColorAdapter implements JsonSerializer, JsonDeserializer\n{\n    @Override\n    public JsonElement serialize(Color src, Type typeOfSrc, JsonSerializationContext context)\n    {\n        return new JsonPrimitive(Integer.toHexString(src.getRGB()));\n    }\n\n    @Override\n    public Color deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException\n    {\n        return new Color(Integer.valueOf(json.getAsString(), 16), true);\n    }\n}","new_contents":"package editor.util;\n\nimport java.awt.Color;\nimport java.lang.reflect.Type;\n\nimport com.google.gson.JsonDeserializationContext;\nimport com.google.gson.JsonDeserializer;\nimport com.google.gson.JsonElement;\nimport com.google.gson.JsonParseException;\nimport com.google.gson.JsonPrimitive;\nimport com.google.gson.JsonSerializationContext;\nimport com.google.gson.JsonSerializer;\n\npublic class ColorAdapter implements JsonSerializer, JsonDeserializer\n{\n    @Override\n    public JsonElement serialize(Color src, Type typeOfSrc, JsonSerializationContext context)\n    {\n        return new JsonPrimitive(Integer.toHexString(src.getRGB()));\n    }\n\n    @Override\n    public Color deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException\n    {\n        \/\/ Need to parse as a long and cast to int in case the color is white,\n        \/\/ which has value 0xFFFFFFFF and is outside the range of an int\n        return new Color((int)Long.parseLong(json.getAsString(), 16), true);\n    }\n}","subject":"Fix parsing bug for white colors"}
      {"old_contents":"\/*\n * Copyright 2015, TeamDev Ltd. All rights reserved.\n *\n * Redistribution and use in source and\/or binary forms, with or without\n * modification, must retain the above copyright notice and the following\n * disclaimer.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\npackage org.spine3.server.storage.filesystem;\n\nimport org.spine3.server.storage.CommandStorage;\nimport org.spine3.server.storage.CommandStoreRecord;\n\npublic class FileSystemCommandStorage extends CommandStorage {\n\n    @Override\n    protected void write(CommandStoreRecord record) {\n        Helper.write(record);\n    }\n}\n","new_contents":"\/*\n * Copyright 2015, TeamDev Ltd. All rights reserved.\n *\n * Redistribution and use in source and\/or binary forms, with or without\n * modification, must retain the above copyright notice and the following\n * disclaimer.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\npackage org.spine3.server.storage.filesystem;\n\nimport org.spine3.server.storage.CommandStorage;\nimport org.spine3.server.storage.CommandStoreRecord;\n\nimport static com.google.common.base.Preconditions.checkNotNull;\n\npublic class FileSystemCommandStorage extends CommandStorage {\n\n    @Override\n    protected void write(CommandStoreRecord record) {\n        checkNotNull(record, \"CommandRecord shouldn't be null.\");\n        Helper.write(record);\n    }\n\n\n}\n","subject":"Check that command is not null before saving."}
      {"old_contents":"\/*\n * Copyright (C) 2017 the original author or authors.\n *\n * This file is part of jBB Application Project.\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  You may obtain a copy of the License at\n *        http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\/\n\npackage org.jbb.frontend.web.faq.logic;\n\nimport java.util.Set;\nimport javax.validation.ConstraintViolation;\nimport org.springframework.stereotype.Component;\nimport org.springframework.validation.BindingResult;\n\n@Component\npublic class FaqErrorsBindingMapper {\n\n    public void map(Set> constraintViolations, BindingResult bindingResult) {\n        for (ConstraintViolation violation : constraintViolations) {\n            String propertyPath = violation.getPropertyPath().toString();\n            propertyPath = propertyPath.replace(\"questions\", \"entries\");\n            bindingResult.rejectValue(propertyPath, violation.getMessage());\n        }\n    }\n\n}\n","new_contents":"\/*\n * Copyright (C) 2017 the original author or authors.\n *\n * This file is part of jBB Application Project.\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  You may obtain a copy of the License at\n *        http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\/\n\npackage org.jbb.frontend.web.faq.logic;\n\nimport java.util.Set;\nimport javax.validation.ConstraintViolation;\nimport org.springframework.stereotype.Component;\nimport org.springframework.validation.BindingResult;\n\n@Component\npublic class FaqErrorsBindingMapper {\n\n    public void map(Set> constraintViolations, BindingResult bindingResult) {\n        for (ConstraintViolation violation : constraintViolations) {\n            String propertyPath = violation.getPropertyPath().toString();\n            propertyPath = propertyPath.replace(\"questions\", \"entries\");\n            bindingResult.rejectValue(propertyPath, \"x\", violation.getMessage());\n        }\n    }\n\n}\n","subject":"Fix error message for empty field in FAQ ACP form"}
      {"old_contents":"\/*******************************************************************************\n * Copyright (c) 2004 Actuate Corporation. All rights reserved. This program and\n * the accompanying materials are made available under the terms of the Eclipse\n * Public License v1.0 which accompanies this distribution, and is available at\n * http:\/\/www.eclipse.org\/legal\/epl-v10.html\n * \n * Contributors: Actuate Corporation - initial API and implementation\n ******************************************************************************\/\n\npackage org.eclipse.birt.report.tests.engine;\n\nimport junit.framework.Test;\nimport junit.framework.TestSuite;\n\nimport org.eclipse.birt.report.tests.engine.api.AllApiTests;\nimport org.eclipse.birt.report.tests.engine.regression.AllRegressionTests;\nimport org.eclipse.birt.report.tests.engine.smoke.AllSmokeTests;\n\npublic class AllTests\n{\n\tpublic static Test suite( )\n\t{\n\t\tTestSuite test = new TestSuite( );\n\t\ttest.addTest( AllRegressionTests.suite( ) );\n\/\/\t\ttest.addTest( AllCompatibilityTests.suite( ) );\n\t\ttest.addTest( AllSmokeTests.suite( ) );\n\t\ttest.addTest( AllApiTests.suite( ) );\n\t\treturn test;\n\t}\n\n}","new_contents":"\/*******************************************************************************\n * Copyright (c) 2004 Actuate Corporation. All rights reserved. This program and\n * the accompanying materials are made available under the terms of the Eclipse\n * Public License v1.0 which accompanies this distribution, and is available at\n * http:\/\/www.eclipse.org\/legal\/epl-v10.html\n * \n * Contributors: Actuate Corporation - initial API and implementation\n ******************************************************************************\/\n\npackage org.eclipse.birt.report.tests.engine;\n\nimport junit.framework.Test;\nimport junit.framework.TestSuite;\n\nimport org.eclipse.birt.report.tests.engine.api.AllApiTests;\n\npublic class AllTests\n{\n\tpublic static Test suite( )\n\t{\n\t\tTestSuite test = new TestSuite( );\n\/\/\t\ttest.addTest( AllRegressionTests.suite( ) );\n\/\/\t\ttest.addTest( AllCompatibilityTests.suite( ) );\n\/\/\t\ttest.addTest( AllSmokeTests.suite( ) );\n\t\ttest.addTest( AllApiTests.suite( ) );\n\t\treturn test;\n\t}\n\n}","subject":"Remove regression, smoke and compatibility package. They have been moved to new test framework except for compatibility which is useless."}
      {"old_contents":"\/*\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage javaemul.internal;\n\nimport jsinterop.annotations.JsMethod;\n\nclass ArrayStamper {\n\n  public static  T[] stampJavaTypeInfo(Object array, T[] referenceType) {\n    T[] asArray = JsUtils.uncheckedCast(array);\n    $copyType(asArray, referenceType);\n    return asArray;\n  }\n\n  @JsMethod(namespace = \"vmbootstrap.Arrays\")\n  public static native  void $copyType(T[] array, T[] referenceType);\n}\n","new_contents":"\/*\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage javaemul.internal;\n\nimport jsinterop.annotations.JsMethod;\n\n\/** A utility to provide array stamping. Provided as a separate class to simplify super-source. *\/\npublic class ArrayStamper {\n\n  public static  T[] stampJavaTypeInfo(Object array, T[] referenceType) {\n    T[] asArray = JsUtils.uncheckedCast(array);\n    $copyType(asArray, referenceType);\n    return asArray;\n  }\n\n  @JsMethod(namespace = \"vmbootstrap.Arrays\")\n  public static native  void $copyType(T[] array, T[] referenceType);\n}\n","subject":"Add helper method on JsArray for easing conversion from\/to java array."}
      {"old_contents":"package org.wildfly.swarm.ribbon.webapp.runtime;\n\nimport org.jboss.shrinkwrap.api.Archive;\nimport org.jboss.shrinkwrap.api.ShrinkWrap;\nimport org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;\nimport org.wildfly.swarm.container.runtime.AbstractServerConfiguration;\nimport org.wildfly.swarm.netflix.ribbon.RibbonArchive;\nimport org.wildfly.swarm.ribbon.webapp.RibbonWebAppFraction;\nimport org.wildfly.swarm.undertow.WARArchive;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n\n\/**\n * @author Lance Ball\n *\/\npublic class RibbonWebAppConfiguration extends AbstractServerConfiguration {\n\n    public RibbonWebAppConfiguration() {\n        super(RibbonWebAppFraction.class);\n    }\n\n    @Override\n    public RibbonWebAppFraction defaultFraction() {\n        return new RibbonWebAppFraction();\n    }\n\n    @Override\n    public List getImplicitDeployments(RibbonWebAppFraction fraction) throws Exception {\n        List list = new ArrayList<>();\n        WARArchive war = ShrinkWrap.create( WARArchive.class );\n        war.addClass( RibbonToTheCurbSSEServlet.class );\n        war.addModule(\"org.wildfly.swarm.netflix.ribbon\");\n        war.addAsWebResource(new ClassLoaderAsset(\"ribbon.js\", this.getClass().getClassLoader()), \"ribbon.js\");\n        war.setContextRoot(\"\/ribbon\");\n        war.as(RibbonArchive.class);\n        list.add(war);\n        return list;\n    }\n\n}\n","new_contents":"package org.wildfly.swarm.ribbon.webapp.runtime;\n\nimport org.jboss.shrinkwrap.api.Archive;\nimport org.jboss.shrinkwrap.api.ShrinkWrap;\nimport org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;\nimport org.wildfly.swarm.container.runtime.AbstractServerConfiguration;\nimport org.wildfly.swarm.netflix.ribbon.RibbonArchive;\nimport org.wildfly.swarm.ribbon.webapp.RibbonWebAppFraction;\nimport org.wildfly.swarm.undertow.WARArchive;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n\n\/**\n * @author Lance Ball\n *\/\npublic class RibbonWebAppConfiguration extends AbstractServerConfiguration {\n\n    private static final String DEFAULT_CONTEXT = \"\/ribbon\";\n\n    public RibbonWebAppConfiguration() {\n        super(RibbonWebAppFraction.class);\n    }\n\n    @Override\n    public RibbonWebAppFraction defaultFraction() {\n        return new RibbonWebAppFraction();\n    }\n\n    @Override\n    public List getImplicitDeployments(RibbonWebAppFraction fraction) throws Exception {\n        String context = System.getProperty( \"wildfly.swarm.ribbon.context.path\" );\n        if (context == null) context = DEFAULT_CONTEXT;\n\n        List list = new ArrayList<>();\n        WARArchive war = ShrinkWrap.create( WARArchive.class );\n        war.addClass( RibbonToTheCurbSSEServlet.class );\n        war.addModule(\"org.wildfly.swarm.netflix.ribbon\");\n        war.addAsWebResource(new ClassLoaderAsset(\"ribbon.js\", this.getClass().getClassLoader()), \"ribbon.js\");\n        war.setContextRoot(context);\n        war.as(RibbonArchive.class);\n        list.add(war);\n        return list;\n    }\n\n}\n","subject":"Make ribbon-webapp's context path configurable."}
      {"old_contents":"package edu.usc.glidein.service.db;\n\nimport edu.usc.glidein.stubs.types.Site;\nimport edu.usc.glidein.stubs.types.SiteStatus;\n\npublic interface SiteDAO\n{\n\tpublic int create(Site site) throws DatabaseException;\n\tpublic void store(Site site) throws DatabaseException;\n\tpublic Site load(int siteId) throws DatabaseException;\n\tpublic void delete(int siteId) throws DatabaseException;\n\tpublic SiteStatus getStatus(int siteId) throws DatabaseException;\n\tpublic void updateStatus(int siteId, SiteStatus status) throws DatabaseException;\n}\n","new_contents":"package edu.usc.glidein.service.db;\n\nimport edu.usc.glidein.stubs.types.Site;\nimport edu.usc.glidein.stubs.types.SiteStatus;\n\npublic interface SiteDAO\n{\n\tpublic int create(Site site) throws DatabaseException;\n\tpublic void store(Site site) throws DatabaseException;\n\tpublic Site load(int siteId) throws DatabaseException;\n\tpublic void delete(int siteId) throws DatabaseException;\n\tpublic void updateStatus(int siteId, SiteStatus status, String statusMessage) throws DatabaseException;\n\tpublic Site[] list(boolean full) throws DatabaseException;\n}\n","subject":"Remove getStatus Modify updateStatus Add list"}
      {"old_contents":"package com.campmongoose.serversaturday.common.submission;\n\nimport java.io.File;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.UUID;\nimport javax.annotation.Nonnull;\nimport javax.annotation.Nullable;\n\npublic abstract class AbstractSubmitter {\n\n    protected final Map builds = new HashMap<>();\n    @Nonnull\n    protected final String name;\n    @Nonnull\n    protected final UUID uuid;\n\n    protected AbstractSubmitter(@Nonnull String name, @Nonnull UUID uuid) {\n        this.name = name;\n        this.uuid = uuid;\n    }\n\n    @Nullable\n    public B getBuild(@Nonnull String name) {\n        return builds.get(name);\n    }\n\n    @Nonnull\n    public List getBuilds() {\n        return new ArrayList<>(builds.values());\n    }\n\n    @Nonnull\n    public abstract I getMenuRepresentation();\n\n    @Nonnull\n    public String getName() {\n        return name;\n    }\n\n    @Nonnull\n    public UUID getUUID() {\n        return uuid;\n    }\n\n    @Nonnull\n    public abstract B newBuild(@Nonnull String name, @Nonnull L location);\n\n    public boolean removeBuild(@Nonnull String name) {\n        return builds.remove(name) != null;\n    }\n\n    public abstract void save(@Nonnull File file);\n}\n","new_contents":"package com.campmongoose.serversaturday.common.submission;\n\nimport java.io.File;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.UUID;\nimport javax.annotation.Nonnull;\nimport javax.annotation.Nullable;\n\npublic abstract class AbstractSubmitter {\n\n    protected final Map builds = new HashMap<>();\n    @Nonnull\n    protected final String name;\n    @Nonnull\n    protected final UUID uuid;\n\n    protected AbstractSubmitter(@Nonnull String name, @Nonnull UUID uuid) {\n        this.name = name;\n        this.uuid = uuid;\n    }\n\n    @Nullable\n    public B getBuild(@Nonnull String name) {\n        return builds.get(name);\n    }\n\n    @Nonnull\n    public List getBuilds() {\n        return new ArrayList<>(builds.values());\n    }\n\n    @Nonnull\n    public abstract I getMenuRepresentation();\n\n    @Nonnull\n    public String getName() {\n        return name;\n    }\n\n    @Nonnull\n    public UUID getUUID() {\n        return uuid;\n    }\n\n    @Nonnull\n    public abstract B newBuild(@Nonnull String name, @Nonnull L location);\n\n    public boolean removeBuild(@Nonnull String name) {\n        return builds.remove(name) != null;\n    }\n\n    public void renameBuild(String newName, B build) {\n        builds.remove(build.getName());\n        build.setName(newName);\n        builds.put(newName, build);\n    }\n\n    public abstract void save(@Nonnull File file);\n}\n","subject":"Fix an issue with updating builds."}
      {"old_contents":"package io.elssa.nn;\n\npublic class ElssaMessage {\n\n    private byte[] payload;\n\n    \/**\n     * Constructs an ElssaMessage from an array of bytes.\n     *\n     * @param payload message payload in the form of a byte array.\n     *\/\n    public ElssaMessage(byte[] payload) {\n        this.payload = payload;\n    }\n\n    \/**\n     * Retrieves the payload for this ElssaMessage.\n     *\n     * @return the ElssaMessage payload\n     *\/\n    public byte[] payload() {\n        return payload;\n    }\n}\n","new_contents":"package io.elssa.nn;\n\npublic class ElssaMessage {\n\n    private byte[] payload;\n    private MessageContext context;\n\n    \/**\n     * Constructs an ElssaMessage from an array of bytes.\n     *\n     * @param payload message payload in the form of a byte array.\n     *\/\n    public ElssaMessage(byte[] payload) {\n        this.payload = payload;\n    }\n\n    public ElssaMessage(byte[] payload, MessageContext context) {\n        this(payload);\n        this.context = context;\n    }\n\n    \/**\n     * Retrieves the payload for this ElssaMessage.\n     *\n     * @return the ElssaMessage payload\n     *\/\n    public byte[] payload() {\n        return payload;\n    }\n\n    public MessageContext context() {\n        return context;\n    }\n}\n","subject":"Add context to message encapsulation"}
      {"old_contents":"package io.reflectoring.coderadar.graph.query.repository;\n\nimport io.reflectoring.coderadar.analyzer.domain.Commit;\nimport io.reflectoring.coderadar.graph.analyzer.domain.CommitEntity;\nimport java.util.List;\nimport org.springframework.data.neo4j.annotation.Query;\nimport org.springframework.data.neo4j.repository.Neo4jRepository;\nimport org.springframework.stereotype.Repository;\n\n@Repository\npublic interface GetCommitsInProjectRepository extends Neo4jRepository {\n\n  @Query(\n      \"MATCH (p:ProjectEntity)-[:CONTAINS]->(f:FileEntity)-[:CHANGED_IN]->(c:CommitEntity) WHERE ID(p) = {0} RETURN c \"\n          + \"UNION MATCH (p:ProjectEntity)-[:CONTAINS]->(m:ModuleEntity)-[:CONTAINS]->(f:FileEntity)-[:CHANGED_IN]->(c:CommitEntity) WHERE ID(p) = {0} RETURN c\")\n  List findByProjectId(Long projectId);\n\n  @Query(\n    value =\n        \"MATCH (p:Project)-[:HAS]->(c:Commit) WHERE ID(p) = {0} RETURN c ORDER BY c.sequenceNumber DESC LIMIT 1\"\n  )\n  Commit findTop1ByProjectIdOrderBySequenceNumberDesc(Long id);\n}\n","new_contents":"package io.reflectoring.coderadar.graph.query.repository;\n\nimport io.reflectoring.coderadar.analyzer.domain.Commit;\nimport io.reflectoring.coderadar.graph.analyzer.domain.CommitEntity;\nimport java.util.List;\nimport org.springframework.data.neo4j.annotation.Query;\nimport org.springframework.data.neo4j.repository.Neo4jRepository;\nimport org.springframework.stereotype.Repository;\n\n@Repository\npublic interface GetCommitsInProjectRepository extends Neo4jRepository {\n\n  @Query(\"MATCH (p1:ProjectEntity)-[:CONTAINS*]-(f1:FileEntity)-[:CHANGED_IN]->(c1:CommitEntity) \" +\n          \"OPTIONAL MATCH (c2:CommitEntity)-[:IS_CHILD_OF]->(c1:CommitEntity) \" +\n          \"WHERE ID(p1) = {0} \" +\n          \"UNWIND [c1, c2] AS c \" +\n          \"RETURN DISTINCT c \" +\n          \"ORDER BY c.timestamp DESC\")\n  List findByProjectId(Long projectId);\n\n  @Query(\n    value =\n        \"MATCH (p:Project)-[:HAS]->(c:Commit) WHERE ID(p) = {0} RETURN c ORDER BY c.sequenceNumber DESC LIMIT 1\"\n  )\n  Commit findTop1ByProjectIdOrderBySequenceNumberDesc(Long id);\n}\n","subject":"Update the query for finding all commits belonging to a project"}
      {"old_contents":"package org.wikipedia.search;\n\nimport android.content.Context;\nimport android.content.Intent;\n\nimport androidx.annotation.NonNull;\nimport androidx.annotation.Nullable;\n\nimport org.wikipedia.Constants.InvokeSource;\nimport org.wikipedia.WikipediaApp;\nimport org.wikipedia.activity.SingleFragmentActivity;\nimport org.wikipedia.analytics.IntentFunnel;\n\nimport static org.wikipedia.Constants.INTENT_EXTRA_INVOKE_SOURCE;\nimport static org.wikipedia.Constants.InvokeSource.WIDGET;\n\npublic class SearchActivity extends SingleFragmentActivity {\n    static final String QUERY_EXTRA = \"query\";\n\n    public static Intent newIntent(@NonNull Context context, InvokeSource source, @Nullable String query) {\n\n        if (source == WIDGET) {\n            new IntentFunnel(WikipediaApp.getInstance()).logSearchWidgetTap();\n        }\n\n        \/\/ We use the ordinal() for passing the INVOKE_SOURCE into the intent because this intent\n        \/\/ could be used as part of an App Shortcut, and unfortunately app shortcuts do not allow\n        \/\/ Serializable objects in their intents.\n        return new Intent(context, SearchActivity.class)\n                .putExtra(INTENT_EXTRA_INVOKE_SOURCE, source.ordinal())\n                .putExtra(QUERY_EXTRA, query);\n    }\n\n    @Override\n    public SearchFragment createFragment() {\n        return SearchFragment.newInstance(InvokeSource.values()[getIntent().getIntExtra(INTENT_EXTRA_INVOKE_SOURCE, InvokeSource.TOOLBAR.ordinal())],\n                getIntent().getStringExtra(QUERY_EXTRA));\n    }\n}\n","new_contents":"package org.wikipedia.search;\n\nimport android.content.Context;\nimport android.content.Intent;\n\nimport androidx.annotation.NonNull;\nimport androidx.annotation.Nullable;\n\nimport org.wikipedia.Constants.InvokeSource;\nimport org.wikipedia.WikipediaApp;\nimport org.wikipedia.activity.SingleFragmentActivity;\nimport org.wikipedia.analytics.IntentFunnel;\n\nimport static org.wikipedia.Constants.INTENT_EXTRA_INVOKE_SOURCE;\nimport static org.wikipedia.Constants.InvokeSource.WIDGET;\n\npublic class SearchActivity extends SingleFragmentActivity {\n    static final String QUERY_EXTRA = \"query\";\n\n    public static Intent newIntent(@NonNull Context context, InvokeSource source, @Nullable String query) {\n\n        if (source == WIDGET) {\n            new IntentFunnel(WikipediaApp.getInstance()).logSearchWidgetTap();\n        }\n\n        return new Intent(context, SearchActivity.class)\n                .putExtra(INTENT_EXTRA_INVOKE_SOURCE, source)\n                .putExtra(QUERY_EXTRA, query);\n    }\n\n    @Override\n    public SearchFragment createFragment() {\n        return SearchFragment.newInstance((InvokeSource) getIntent().getSerializableExtra(INTENT_EXTRA_INVOKE_SOURCE),\n                getIntent().getStringExtra(QUERY_EXTRA));\n    }\n}\n","subject":"Undo ordinal conversion, since this is now a static shortcut."}
      {"old_contents":"package cz.metacentrum.perun.wui.registrar.widgets.items.validators;\n\nimport cz.metacentrum.perun.wui.registrar.widgets.items.Radiobox;\nimport org.gwtbootstrap3.client.ui.constants.ValidationState;\n\n\/**\n * @author Ondrej Velisek \n *\/\npublic class RadioboxValidator extends PerunFormItemValidatorImpl {\n\n\t@Override\n\tpublic boolean validateLocal(Radiobox radiobox) {\n\n\t\tif (radiobox.isRequired() && isNullOrEmpty(radiobox.getValue())) {\n\t\t\tsetResult(Result.EMPTY);\n\t\t\tradiobox.setStatus(getTransl().cantBeEmpty(), ValidationState.ERROR);\n\t\t\treturn false;\n\t\t}\n\n\t\tradiobox.setStatus(ValidationState.SUCCESS);\n\t\treturn true;\n\t}\n\n}","new_contents":"package cz.metacentrum.perun.wui.registrar.widgets.items.validators;\n\nimport com.google.gwt.regexp.shared.MatchResult;\nimport com.google.gwt.regexp.shared.RegExp;\nimport cz.metacentrum.perun.wui.registrar.widgets.items.Radiobox;\nimport org.gwtbootstrap3.client.ui.constants.ValidationState;\n\n\/**\n * @author Ondrej Velisek \n *\/\npublic class RadioboxValidator extends PerunFormItemValidatorImpl {\n\n\t@Override\n\tpublic boolean validateLocal(Radiobox radiobox) {\n\n\t\tif (radiobox.isRequired() && isNullOrEmpty(radiobox.getValue())) {\n\t\t\tsetResult(Result.EMPTY);\n\t\t\tradiobox.setStatus(getTransl().cantBeEmpty(), ValidationState.ERROR);\n\t\t\treturn false;\n\t\t}\n\n\t\tString regex = radiobox.getItemData().getFormItem().getRegex();\n\n\t\tif (regex != null && !regex.equals(\"\")) {\n\n\t\t\tRegExp regExp = RegExp.compile(regex);\n\t\t\tMatchResult matcher = regExp.exec(radiobox.getValue());\n\t\t\tboolean matchFound = (matcher != null); \/\/ equivalent to regExp.test(inputStr);\n\t\t\tif(!matchFound){\n\n\t\t\t\tsetResult(Result.INVALID_FORMAT);\n\t\t\t\tradiobox.setStatus(getErrorMsgOrDefault(radiobox), ValidationState.ERROR);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tradiobox.setStatus(ValidationState.SUCCESS);\n\t\treturn true;\n\t}\n\n}\n","subject":"Allow regex check on radio buttons on registration forms"}
      {"old_contents":"package com.byteowls.vaadin.chartjs;\n\nimport com.vaadin.shared.ui.JavaScriptComponentState;\nimport elemental.json.JsonValue;\n\npublic class ChartJsState extends JavaScriptComponentState {\n\n    public float width;\n    public float height;\n    public boolean loggingEnabled;\n    public JsonValue configurationJson;\n\n}\n","new_contents":"package com.byteowls.vaadin.chartjs;\n\nimport com.vaadin.shared.ui.JavaScriptComponentState;\nimport elemental.json.JsonValue;\n\npublic class ChartJsState extends JavaScriptComponentState {\n\n    private static final long serialVersionUID = 542472889885500321L;\n    \n    public boolean loggingEnabled;\n    public JsonValue configurationJson;\n\n}\n","subject":"Remove redunant height and width members. using the inheritated ones"}
      {"old_contents":"\/*\n * Copyright 2013-2017 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\/\n\npackage org.springframework.cloud.gateway.filter.factory;\n\nimport org.springframework.tuple.Tuple;\nimport org.springframework.web.server.WebFilter;\n\nimport java.util.Arrays;\nimport java.util.List;\n\n\/**\n * @author Spencer Gibb\n *\/\npublic class SetResponseHeaderWebFilterFactory implements WebFilterFactory {\n\n\t@Override\n\tpublic List argNames() {\n\t\treturn Arrays.asList(NAME_KEY, VALUE_KEY);\n\t}\n\n\t@Override\n\tpublic WebFilter apply(Tuple args) {\n\t\tfinal String header = args.getString(NAME_KEY);\n\t\tfinal String value = args.getString(VALUE_KEY);\n\n\t\treturn (exchange, chain) -> {\n\t\t\texchange.getResponse().getHeaders().set(header, value);\n\n\t\t\treturn chain.filter(exchange);\n\t\t};\n\t}\n}\n","new_contents":"\/*\n * Copyright 2013-2017 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\/\n\npackage org.springframework.cloud.gateway.filter.factory;\n\nimport org.springframework.tuple.Tuple;\nimport org.springframework.web.server.WebFilter;\nimport reactor.core.publisher.Mono;\n\nimport java.util.Arrays;\nimport java.util.List;\n\n\/**\n * @author Spencer Gibb\n *\/\npublic class SetResponseHeaderWebFilterFactory implements WebFilterFactory {\n\n\t@Override\n\tpublic List argNames() {\n\t\treturn Arrays.asList(NAME_KEY, VALUE_KEY);\n\t}\n\n\t@Override\n\tpublic WebFilter apply(Tuple args) {\n\t\tfinal String header = args.getString(NAME_KEY);\n\t\tfinal String value = args.getString(VALUE_KEY);\n\n\t\treturn (exchange, chain) -> chain.filter(exchange).then(Mono.fromRunnable(() -> {\n\t\t\texchange.getResponse().getHeaders().set(header, value);\n\t\t}));\n\t}\n}\n","subject":"Remove header AFTER response is received."}
      {"old_contents":"package org.camunda.bpm.example.multiple_versions_parallel.nonarquillian;\n\nimport org.camunda.bpm.engine.impl.util.LogUtil;\nimport org.camunda.bpm.engine.test.ProcessEngineTestCase;\nimport org.camunda.bpm.engine.test.Deployment;\n\n\/**\n * Test case starting an in-memory database-backed Process Engine.\n *\/\npublic class InMemoryH2Test extends ProcessEngineTestCase {\n\n  private static final String PROCESS_DEFINITION_KEY = \"multiple-versions-parallel\";\n\n  \/\/ enable more detailed logging\n  static {\n    LogUtil.readJavaUtilLoggingConfigFromClasspath();\n  }\n\n  \/**\n   * Just tests if the process definition is deployable.\n   *\/\n  @Deployment(resources = \"process.bpmn\")\n  public void testParsingAndDeployment() {\n    \/\/ nothing is done here, as we just want to check for exceptions during deployment\n  }\n\n}\n","new_contents":"package org.camunda.bpm.example.multiple_versions_parallel.nonarquillian;\n\nimport java.io.IOException;\nimport java.util.Properties;\nimport java.util.ResourceBundle;\n\nimport org.camunda.bpm.engine.impl.util.LogUtil;\nimport org.camunda.bpm.engine.test.ProcessEngineTestCase;\nimport org.camunda.bpm.engine.test.Deployment;\n\n\/**\n * Test case starting an in-memory database-backed Process Engine.\n *\/\npublic class InMemoryH2Test extends ProcessEngineTestCase {\n\n  private static final String PROCESS_DEFINITION_KEY = \"multiple-versions-parallel-v\";\n\n  \/\/ enable more detailed logging\n  static {\n    LogUtil.readJavaUtilLoggingConfigFromClasspath();\n  }\n\n  \/**\n   * Just tests if the process definition is deployable.\n   * @throws IOException \n   *\/\n  @Deployment(resources = \"process.bpmn\")\n  public void testParsingAndDeployment() throws IOException {\n    Properties version = new Properties();\n    version.load(this.getClass().getResourceAsStream(\"\/version.properties\"));\n    runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY + version.getProperty(\"maven.version.major\") + \".\" + version.getProperty(\"maven.version.minor\"));\n  }\n\n}\n","subject":"Access version in test case"}
      {"old_contents":"package nl.homeserver.klimaat;\n\nimport java.math.BigDecimal;\nimport java.time.LocalDateTime;\n\nimport lombok.Data;\nimport nl.homeserver.Trend;\n\n@Data\npublic class RealtimeKlimaat {\n    private LocalDateTime datumtijd;\n    private BigDecimal temperatuur;\n    private BigDecimal luchtvochtigheid;\n    private Trend temperatuurTrend;\n    private Trend luchtvochtigheidTrend;\n}\n","new_contents":"package nl.homeserver.klimaat;\n\nimport java.math.BigDecimal;\nimport java.time.LocalDateTime;\n\nimport lombok.Getter;\nimport lombok.Setter;\nimport nl.homeserver.Trend;\n\npublic class RealtimeKlimaat {\n    @Getter @Setter\n    private LocalDateTime datumtijd;\n    @Getter @Setter\n    private BigDecimal temperatuur;\n    @Getter @Setter\n    private BigDecimal luchtvochtigheid;\n    @Getter @Setter\n    private Trend temperatuurTrend;\n    @Getter @Setter\n    private Trend luchtvochtigheidTrend;\n}\n","subject":"Replace @Data by @Getter and @Setter"}
      {"old_contents":"package net.aeten.core.spi;\n\n\/**\n *\n * @author Thomas Pérennou\n *\/\npublic @interface Configuration {\n\tString name();\n\tClass provider();\n\tString parser() default \"\";\n}\n","new_contents":"package net.aeten.core.spi;\n\nimport java.lang.annotation.Documented;\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n\/**\n *\n * @author Thomas Pérennou\n *\/\n@Documented\n@Retention(RetentionPolicy.SOURCE)\n@Target({ElementType.PACKAGE, ElementType.TYPE})\npublic @interface Configuration {\n\tString name();\n\tClass provider();\n\tString parser() default \"\";\n}\n","subject":"Add Documented, Retention and Target annotations"}
      {"old_contents":"package com.ibm.watson.common;\n\nimport com.ibm.cloud.sdk.core.http.HttpHeaders;\nimport com.ibm.cloud.sdk.core.test.WatsonServiceUnitTest;\nimport org.junit.Test;\n\nimport java.util.Map;\n\nimport static org.junit.Assert.assertTrue;\n\npublic class SdkCommonTest extends WatsonServiceUnitTest {\n  @Test\n  public void testGetDefaultHeaders() {\n    String serviceName = \"test_name\";\n    String serviceVersion = \"v1\";\n    String operationId = \"test_method\";\n    Map defaultHeaders = SdkCommon.getDefaultHeaders(serviceName, serviceVersion, operationId);\n\n    assertTrue(defaultHeaders.containsKey(HttpHeaders.X_IBMCLOUD_SDK_ANALYTICS));\n    String analyticsHeaderValue = defaultHeaders.get(HttpHeaders.X_IBMCLOUD_SDK_ANALYTICS);\n    assertTrue(analyticsHeaderValue.contains(serviceName));\n    assertTrue(analyticsHeaderValue.contains(serviceVersion));\n    assertTrue(analyticsHeaderValue.contains(operationId));\n    assertTrue(defaultHeaders.containsKey(HttpHeaders.USER_AGENT));\n    assertTrue(defaultHeaders.get(HttpHeaders.USER_AGENT).startsWith(\"watson-apis-java-sdk\/\"));\n  }\n}\n","new_contents":"package com.ibm.watson.common;\n\nimport com.ibm.cloud.sdk.core.http.HttpHeaders;\nimport org.junit.Test;\n\nimport java.util.Map;\n\nimport static org.junit.Assert.assertTrue;\n\npublic class SdkCommonTest {\n  @Test\n  public void testGetDefaultHeaders() {\n    String serviceName = \"test_name\";\n    String serviceVersion = \"v1\";\n    String operationId = \"test_method\";\n    Map defaultHeaders = SdkCommon.getDefaultHeaders(serviceName, serviceVersion, operationId);\n\n    assertTrue(defaultHeaders.containsKey(WatsonHttpHeaders.X_IBMCLOUD_SDK_ANALYTICS));\n    String analyticsHeaderValue = defaultHeaders.get(WatsonHttpHeaders.X_IBMCLOUD_SDK_ANALYTICS);\n    assertTrue(analyticsHeaderValue.contains(serviceName));\n    assertTrue(analyticsHeaderValue.contains(serviceVersion));\n    assertTrue(analyticsHeaderValue.contains(operationId));\n    assertTrue(defaultHeaders.containsKey(HttpHeaders.USER_AGENT));\n    assertTrue(defaultHeaders.get(HttpHeaders.USER_AGENT).startsWith(\"watson-apis-java-sdk\/\"));\n  }\n}\n","subject":"Remove unnecessary extension and change header class reference"}
      {"old_contents":"\/\/ Get JAFFE database from http:\/\/www.kasrl.org\/jaffe_info.html\n\/\/ Extract pics in folder named \"jaffe\"\n\/\/ package image_test;\n\nimport java.awt.image.BufferedImage;\nimport java.io.ByteArrayOutputStream;\nimport java.io.ByteArrayInputStream;\nimport java.io.File;\nimport java.io.IOException;\nimport javax.imageio.ImageIO;\n\npublic class svq {\n\n    public static void main(String[] args) {\n        \/\/ read image\n        BufferedImage input = null;\n        try {\n            input = ImageIO.read(new File(\"jaffe\/KA.AN1.39.tiff.bmp\"));\n        } catch (IOException e) {\n            throw new RuntimeException(e);\n        }\n\n        \/\/ to byte array\n        ByteArrayOutputStream baos = new ByteArrayOutputStream();\n        try {\n            ImageIO.write( input, \"bmp\", baos );\n            baos.flush();\n        } catch (IOException e) {\n\n        }\n        byte[] bytearray = baos.toByteArray();\n\n        \/\/ to BufferedImage\n        ByteArrayInputStream bais = new ByteArrayInputStream(bytearray);\n        BufferedImage output = null;\n        try {\n            output = ImageIO.read(bais);\n            bais.close();\n        } catch (IOException e) {\n            throw new RuntimeException(e);\n        }\n\n        System.out.println(\"Done!\");\n    }\n}","new_contents":"\/\/ Get JAFFE database from http:\/\/www.kasrl.org\/jaffe_info.html\n\/\/ Extract pics in folder named \"jaffe\"\n\/\/ package image_test;\n\nimport java.awt.image.BufferedImage;\nimport java.io.ByteArrayOutputStream;\nimport java.io.ByteArrayInputStream;\nimport java.io.File;\nimport java.io.IOException;\nimport javax.imageio.ImageIO;\n\npublic class svq {\n\n    public static void main(String[] args) {\n        \/\/ read image\n        BufferedImage input = null;\n        try {\n            input = ImageIO.read(new File(\"jaffe\/KA.AN1.39.tiff.bmp\"));\n        } catch (IOException e) {\n            throw new RuntimeException(e);\n        }\n\n        \/\/ to byte array\n        ByteArrayOutputStream baos = new ByteArrayOutputStream();\n        try {\n            ImageIO.write( input, \"bmp\", baos );\n            baos.flush();\n        } catch (IOException e) {\n\n        }\n        byte[] bytearray = baos.toByteArray();\n\n        \/\/ to BufferedImage\n        ByteArrayInputStream bais = new ByteArrayInputStream(bytearray);\n        BufferedImage output = null;\n        try {\n            output = ImageIO.read(bais);\n            bais.close();\n        } catch (IOException e) {\n            throw new RuntimeException(e);\n        }\n\n        \/\/ save result\n        try {\n            ImageIO.write(output, \"BMP\", new File(\"test.bmp\"));\n        } catch (IOException e) {\n            throw new RuntimeException(e);\n        }\n\n        System.out.println(\"Done!\");\n    }\n}","subject":"Save buffered image as bmp"}
      {"old_contents":"package com.almende.util;\n\nimport com.almende.dialog.aws.AWSClient;\n\npublic class AWSThread extends Thread {\n\n    @Override\n    public void run() {\n        ParallelInit.awsClient = new AWSClient();\n        ParallelInit.awsClientActive = true;\n    }\n}\n","new_contents":"package com.almende.util;\n\nimport com.almende.dialog.Settings;\nimport com.almende.dialog.aws.AWSClient;\n\npublic class AWSThread extends Thread {\n\n    @Override\n    public void run() {\n        ParallelInit.awsClient = new AWSClient();\n        ParallelInit.awsClient.init( Settings.BUCKET_NAME, Settings.AWS_ACCESS_KEY, Settings.AWS_ACCESS_KEY_SECRET );\n        ParallelInit.awsClientActive = true;\n    }\n}\n","subject":"Put init back in aws client"}
      {"old_contents":"package com.letscode.lcg;\n\nimport java.util.Random;\n\nimport com.badlogic.gdx.backends.lwjgl.LwjglApplication;\nimport com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tLwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();\n\t\tString hostname = args.length > 0 ? args[0] : \"localhost\";\n\t\tint port = args.length > 1 ? Integer.parseInt(args[1]) : 80;\n\t\tString nickname = args.length > 2 ? args[2] : \"Player \" + (new Random().nextInt(12415124));\n\t\t\n\t\tcfg.title = \"Lambda Cipher Genesis - \" + nickname;\n\t\tcfg.useGL20 = false;\n\t\t\n\t\t{\n\t\t\tcfg.width = 1024;\n\t\t\tcfg.height = 600;\n\t\t}\n\t\tnew LwjglApplication(new LcgApp(hostname, port, nickname), cfg);\n\t}\n}\n","new_contents":"package com.letscode.lcg;\n\nimport java.util.Random;\n\nimport com.badlogic.gdx.backends.lwjgl.LwjglApplication;\nimport com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tLwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();\n\t\tString hostname = args.length > 0 ? args[0] : \"localhost\";\n\t\tint port = args.length > 1 ? Integer.parseInt(args[1]) : 80;\n\t\tString nickname = args.length > 2 ? args[2] : null;\/\/\"Player \" + (new Random().nextInt(12415124));\n\t\t\n\t\tfinal String gameTitle = \"Lambda Cipher Genesis\";\n\t\t\n\t\tcfg.title = nickname != null ? gameTitle + \" - \" + nickname : gameTitle;\n\t\tcfg.useGL20 = false;\n\t\tcfg.width = 1024;\n\t\tcfg.height = 600;\n\n\t\tnew LwjglApplication(new LcgApp(hostname, port, nickname), cfg);\n\t}\n}\n","subject":"Fix desktop version for crash in situation when no parameters are given."}
      {"old_contents":"package com.github.zhanhb.judge.common;\n\nimport java.nio.file.Path;\nimport lombok.Builder;\nimport lombok.Getter;\nimport lombok.Value;\n\n@Builder(builderClassName = \"Builder\")\n@Getter\n@Value\n@SuppressWarnings(\"FinalClass\")\npublic class Options {\n\n    private Path inputFile;\n    private Path errFile;\n    private Path outputFile; \/\/ 提交程序的输出文件\n    private Path standardOutput; \/\/ 标程输出的文件\n    private long timeLimit;\n    private long memoryLimit;\n    private long outputLimit;\n    private boolean redirectErrorStream;\n    private String command;\n    private Path workDirectory;\n\n}\n","new_contents":"package com.github.zhanhb.judge.common;\n\nimport java.nio.file.Path;\nimport lombok.Builder;\nimport lombok.Getter;\nimport lombok.Value;\n\n@Builder(builderClassName = \"Builder\")\n@Getter\n@Value\n@SuppressWarnings(\"FinalClass\")\npublic class Options {\n\n    private Path inputFile;\n    private Path errFile;\n    private Path outputFile; \/\/ 提交程序的输出文件\n    private Path standardOutput; \/\/ 标程输出的文件\n    private long timeLimit;\n    private long memoryLimit;\n    private long outputLimit;\n    private boolean redirectErrorStream;\n    private String command;\n    private Path workDirectory;\n\n    @SuppressWarnings(\"PublicInnerClass\")\n    public static class Builder {\n\n        Builder() {\n            timeLimit = Long.MAX_VALUE;\n            memoryLimit = Long.MAX_VALUE;\n            outputLimit = Long.MAX_VALUE;\n        }\n\n    }\n\n}\n","subject":"Add default option builder limits"}
      {"old_contents":"\npackage com.edinarobotics.zeke.commands;\n\nimport edu.wpi.first.wpilibj.command.Command;\nimport com.edinarobotics.utils.gamepad.Gamepad;\nimport com.edinarobotics.zeke.subsystems.DrivetrainStrafe;\nimport com.edinarobotics.zeke.Components;\nimport com.edinarobotics.utils.gamepad.GamepadAxisState;\n\npublic class GamepadDriveStrafeCommand extends Command {\n    private Gamepad gamepad;\n    private GamepadAxisState gamepadAxisState;\n    private DrivetrainStrafe drivetrainStrafe;\n    \n    public GamepadDriveStrafeCommand(Gamepad gamepad) {\n        super(\"GamepadDriveStrafe\");\n        this.gamepad = gamepad;\n        this.drivetrainStrafe = Components.getInstance().drivetrainStrafe;\n        requires(drivetrainStrafe);\n    }\n\n    protected void initialize() {\n    }\n\n    protected void execute() {\n        double magnitude = gamepad.getGamepadAxisState().getLeftMagnitude();\n        double direction = gamepad.getGamepadAxisState().getLeftDirection();\n        drivetrainStrafe.setMecanumPolarStrafe(magnitude, direction);\n    }\n\n    protected boolean isFinished() {\n        return false;\n    }\n\n    protected void end() {\n    }\n\n    protected void interrupted() {\n        end();\n    }\n    \n}\n","new_contents":"\npackage com.edinarobotics.zeke.commands;\n\nimport edu.wpi.first.wpilibj.command.Command;\nimport com.edinarobotics.utils.gamepad.Gamepad;\nimport com.edinarobotics.zeke.subsystems.DrivetrainStrafe;\nimport com.edinarobotics.zeke.Components;\nimport com.edinarobotics.utils.gamepad.GamepadAxisState;\n\npublic class GamepadDriveStrafeCommand extends Command {\n    private Gamepad gamepad;\n    private GamepadAxisState gamepadAxisState;\n    private DrivetrainStrafe drivetrainStrafe;\n    \n    public GamepadDriveStrafeCommand(Gamepad gamepad) {\n        super(\"GamepadDriveStrafe\");\n        this.gamepad = gamepad;\n        this.drivetrainStrafe = Components.getInstance().drivetrainStrafe;\n        requires(drivetrainStrafe);\n    }\n\n    protected void initialize() {\n    }\n\n    protected void execute() {\n        double magnitude = gamepad.getGamepadAxisState().getLeftMagnitude();\n        double direction = wpilibAngleCorrection(gamepad.getGamepadAxisState().getLeftDirection());\n        drivetrainStrafe.setMecanumPolarStrafe(magnitude, direction);\n    }\n\n    protected boolean isFinished() {\n        return false;\n    }\n\n    protected void end() {\n    }\n\n    protected void interrupted() {\n        end();\n    }\n    \n    public static double wpilibAngleCorrection(double normalAngle){\n        \/\/Converts normal angle format to the weird WPILib measurement\n        double convertedAngle = (normalAngle - 90.0) * -1.0;\n        if(convertedAngle > 180.0){\n            return convertedAngle - 360.0;\n        }\n        else if(convertedAngle < -180.0){\n            return convertedAngle + 360.0;\n        }\n        return convertedAngle;\n    }\n    \n}\n","subject":"Add angle correction to normal robot code."}
      {"old_contents":"package hudson.model;\n\nimport hudson.model.Slave.ComputerImpl;\nimport hudson.triggers.SafeTimerTask;\n\n\/**\n * Periodically checks the slaves and try to reconnect dead slaves.\n *\n * @author Kohsuke Kawaguchi\n *\/\npublic class SlaveReconnectionWork extends SafeTimerTask {\n    protected void doRun() {\n        for(Slave s : Hudson.getInstance().getSlaves()) {\n            ComputerImpl c = s.getComputer();\n            if(c==null) \/\/ shouldn't happen, but let's be defensive\n                continue;\n            if(c.isOffline() && c.isStartSupported())\n                c.tryReconnect();\n        }\n    }\n}\n","new_contents":"package hudson.model;\n\nimport hudson.model.Slave.ComputerImpl;\nimport static hudson.model.SlaveAvailabilityStrategy.*;\nimport hudson.triggers.SafeTimerTask;\n\nimport java.util.Map;\nimport java.util.WeakHashMap;\n\n\/**\n * Periodically checks the slaves and try to reconnect dead slaves.\n *\n * @author Kohsuke Kawaguchi\n *\/\npublic class SlaveReconnectionWork extends SafeTimerTask {\n    protected void doRun() {\n        \/\/ use a weak hashmap\n        Map nextCheck = new WeakHashMap();\n        for (Slave s : Hudson.getInstance().getSlaves()) {\n            if (!nextCheck.containsKey(s) || System.currentTimeMillis() > nextCheck.get(s)) {\n                final Queue queue = Hudson.getInstance().getQueue();\n                boolean hasJob = false;\n                for (Executor exec: s.getComputer().getExecutors()) {\n                    if (!exec.isIdle()) {\n                        hasJob = true;\n                        break;\n                    }\n                }\n                \/\/ TODO get only the items from the queue that can apply to this slave\n                State state = new State(queue.getItems().length > 0, hasJob);\n                \/\/ at the moment I don't trust strategies to wait more than 60 minutes\n                \/\/ strategies need to wait at least one minute\n                final long waitInMins = Math.min(1, Math.max(60, s.getAvailabilityStrategy().check(s, state)));\n                nextCheck.put(s, System.currentTimeMillis() + 60 * 1000 * waitInMins);\n            }\n        }\n    }\n}\n","subject":"Make the slave availability strategy actually do stuff!"}
      {"old_contents":"package org.realityforge.ssf;\n\nimport java.util.UUID;\nimport javax.annotation.Nonnull;\nimport javax.inject.Inject;\nimport org.keycloak.adapters.OidcKeycloakAccount;\nimport org.realityforge.keycloak.sks.SimpleAuthService;\n\npublic class SimpleSecureSessionManager\n  extends InMemorySessionManager\n{\n  @Inject\n  private SimpleAuthService _authService;\n\n  @Nonnull\n  @Override\n  protected SimpleSessionInfo newSessionInfo()\n  {\n    final OidcKeycloakAccount account = _authService.getAccount();\n    final String userID = account.getKeycloakSecurityContext().getToken().getId();\n    final String sessionID = UUID.randomUUID().toString();\n    return new SimpleSessionInfo( userID, sessionID );\n  }\n}\n","new_contents":"package org.realityforge.ssf;\n\nimport java.util.UUID;\nimport javax.annotation.Nonnull;\nimport javax.inject.Inject;\nimport org.keycloak.adapters.OidcKeycloakAccount;\nimport org.realityforge.keycloak.sks.SimpleAuthService;\n\npublic class SimpleSecureSessionManager\n  extends InMemorySessionManager\n{\n  @Inject\n  private SimpleAuthService _authService;\n\n  @Nonnull\n  @Override\n  protected SimpleSessionInfo newSessionInfo()\n  {\n    final OidcKeycloakAccount account = _authService.findAccount();\n    final String userID = null == account ? null : account.getKeycloakSecurityContext().getToken().getId();\n    final String sessionID = UUID.randomUUID().toString();\n    return new SimpleSessionInfo( userID, sessionID );\n  }\n}\n","subject":"Allow null users in session manager. If it get's to this point then assume it is ok"}
      {"old_contents":"package handlers;\n\nimport org.atmosphere.config.service.AtmosphereHandlerService;\nimport org.atmosphere.cpr.AtmosphereHandler;\nimport org.atmosphere.cpr.AtmosphereRequest;\nimport org.atmosphere.cpr.AtmosphereResource;\nimport org.atmosphere.cpr.AtmosphereResourceEvent;\n\nimport java.io.IOException;\n\n\/**\n * Created by rostifar on 6\/14\/16.\n *\/\n@AtmosphereHandlerService\npublic class ScrabbleGameHandler implements AtmosphereHandler {\n\n    \/\/action when connection is made to the backend\n\n    @Override\n    public void onRequest(AtmosphereResource atmosphereResource) throws IOException {\n\n        AtmosphereRequest request = atmosphereResource.getRequest();\n\n        System.out.println(\"hi\");\n    }\n\n    \/\/called when Broadcaster broadcasts an event\n    @Override\n    public void onStateChange(AtmosphereResourceEvent atmosphereResourceEvent) throws IOException {\n\n    }\n\n    @Override\n    public void destroy() {\n\n    }\n}\n","new_contents":"package handlers;\n\nimport org.atmosphere.config.service.AtmosphereHandlerService;\nimport org.atmosphere.cpr.*;\n\nimport javax.servlet.RequestDispatcher;\nimport javax.servlet.ServletException;\nimport java.io.IOException;\n\n\/**\n * Created by rostifar on 6\/14\/16.\n *\/\n@AtmosphereHandlerService\npublic class ScrabbleGameHandler implements AtmosphereHandler {\n\n    \/\/action when connection is made to the backend\n\n    @Override\n    public void onRequest(AtmosphereResource atmosphereResource) throws IOException {\n\n        AtmosphereRequest request = atmosphereResource.getRequest();\n        AtmosphereResponse response = atmosphereResource.getResponse();\n\n        System.out.println(\"Called:\" + this.getClass().getName());\n\/\/        request.get\n        RequestDispatcher reqDispatcher = request.getRequestDispatcher(\"\/Index.html\");\n        try {\n            reqDispatcher.forward(request, response);\n        } catch (ServletException e) {\n            e.printStackTrace();\n        }\n    }\n\n    \/\/called when Broadcaster broadcasts an event\n    @Override\n    public void onStateChange(AtmosphereResourceEvent atmosphereResourceEvent) throws IOException {\n\n    }\n\n    @Override\n    public void destroy() {\n\n    }\n}\n","subject":"Join existing game using a game code is now working. Next...fix socket issues."}
      {"old_contents":"package peergos.shared.user.fs;\n\n\/** A Fragment is a part of an EncryptedChunk which is stored directly in IPFS in a raw format block\n *\n *\/\npublic class Fragment {\n    public static final int MAX_LENGTH = 512*1024; \/\/ max size allowed by bitswap protocol is 1 MiB\n\n    public final byte[] data;\n\n    public Fragment(byte[] data) {\n        if (MAX_LENGTH < data.length)\n            throw new IllegalStateException(\"fragment size \"+ data.length +\" greater than max \"+ MAX_LENGTH);\n        this.data = data;\n    }\n}\n","new_contents":"package peergos.shared.user.fs;\n\n\/** A Fragment is a part of an EncryptedChunk which is stored directly in IPFS in a raw format block\n *\n *\/\npublic class Fragment {\n    \/\/ max message size allowed by bitswap protocol is 2 MiB, and the block must fit within that\n    public static final int MAX_LENGTH = 1024*1024;\n\n    public final byte[] data;\n\n    public Fragment(byte[] data) {\n        if (MAX_LENGTH < data.length)\n            throw new IllegalStateException(\"fragment size \"+ data.length +\" greater than max \"+ MAX_LENGTH);\n        this.data = data;\n    }\n}\n","subject":"Increase block size to 1 MiB"}
      {"old_contents":"package org.commcare.android.tasks;\n\nimport org.commcare.android.tasks.ResourceEngineTask.ResourceEngineOutcomes;\nimport org.commcare.resources.model.UnresolvedResourceException;\n\npublic interface ResourceEngineListener {\n    public void reportSuccess(boolean b);\n    public void failMissingResource(UnresolvedResourceException ure, ResourceEngineOutcomes statusmissing);\n    public void failBadReqs(int code, String vReq, String vAvail, boolean majorIsProblem);\n    public void failUnknown(ResourceEngineOutcomes statusfailunknown);\n    public void updateResourceProgress(int done, int pending, int phase);\n    public void failWithNotification(ResourceEngineOutcomes statusfailstate);\n}","new_contents":"package org.commcare.android.tasks;\n\nimport org.commcare.android.tasks.ResourceEngineTask.ResourceEngineOutcomes;\nimport org.commcare.resources.model.UnresolvedResourceException;\n\npublic interface ResourceEngineListener {\n    void reportSuccess(boolean b);\n    void failMissingResource(UnresolvedResourceException ure, ResourceEngineOutcomes statusmissing);\n    void failBadReqs(int code, String vReq, String vAvail, boolean majorIsProblem);\n    void failUnknown(ResourceEngineOutcomes statusfailunknown);\n    void updateResourceProgress(int done, int pending, int phase);\n    void failWithNotification(ResourceEngineOutcomes statusfailstate);\n}","subject":"Remove redundant 'public' keyword from interface methods"}
      {"old_contents":"package jasenmoloy.wirelesscontrol.mvp;\n\nimport android.app.Application;\n\nimport jasenmoloy.wirelesscontrol.io.OnGeofenceDataLoadFinishedListener;\n\n\/**\n * Created by jasenmoloy on 2\/25\/16.\n *\/\npublic interface MainPresenter extends Application.ActivityLifecycleCallbacks {\n    int MAX_ALLOWABLE_GEOFENCES = 50;\n\n    void onAllPermissionsGranted();\n    boolean allowNewGeofence();\n}\n","new_contents":"package jasenmoloy.wirelesscontrol.mvp;\n\nimport android.app.Application;\n\nimport jasenmoloy.wirelesscontrol.io.OnGeofenceDataLoadFinishedListener;\n\n\/**\n * Created by jasenmoloy on 2\/25\/16.\n *\/\npublic interface MainPresenter extends Application.ActivityLifecycleCallbacks {\n    int MAX_ALLOWABLE_GEOFENCES = 25;\n\n    void onAllPermissionsGranted();\n    boolean allowNewGeofence();\n}\n","subject":"Change max allowable geofences to 25 as the limit per device user is 100. This could cause issues for other applications if we go to high."}
      {"old_contents":"package net.dimensions;\n\npublic class Dimensions\n{\n    public static void init()\n    {\n        System.out.println(\"Initializing Dimensions...\");\n    }\n}","new_contents":"package net.dimensions;\n\nimport java.util.Random;\n\npublic class Dimensions {\n\n    private static Random rand;\n\n    public static void init() {\n        System.out.println(\"Initializing Dimensions...\");\n        rand = new Random();\n    }\n\n    public static Random getRandom(){\n        return rand;\n    }\n}\n","subject":"Add Random instance into main class"}
      {"old_contents":"package me.proxer.library.enums;\n\nimport com.squareup.moshi.Json;\n\n\/**\n * Enum holding the available synonym types.\n *\n * @author Ruben Gees\n *\/\npublic enum SynonymType {\n    @Json(name = \"name\")ORIGINAL,\n    @Json(name = \"nameeng\")ENGLISH,\n    @Json(name = \"nameger\")GERMAN,\n    @Json(name = \"namejap\")JAPANESE,\n    @Json(name = \"namekor\")KOREAN,\n    @Json(name = \"syn\")ORIGINAL_ALTERNATIVE,\n}\n","new_contents":"package me.proxer.library.enums;\n\nimport com.squareup.moshi.Json;\n\n\/**\n * Enum holding the available synonym types.\n *\n * @author Ruben Gees\n *\/\npublic enum SynonymType {\n    @Json(name = \"name\")ORIGINAL,\n    @Json(name = \"nameeng\")ENGLISH,\n    @Json(name = \"nameger\")GERMAN,\n    @Json(name = \"namejap\")JAPANESE,\n    @Json(name = \"namekor\")KOREAN,\n    @Json(name = \"namezhn\")CHINESE,\n    @Json(name = \"syn\")ORIGINAL_ALTERNATIVE,\n}\n","subject":"Add support for chinese synonyms"}
      {"old_contents":"package fi.csc.chipster.rest;\n\nimport java.io.IOException;\n\nimport javax.annotation.Priority;\nimport javax.ws.rs.Priorities;\nimport javax.ws.rs.container.ContainerRequestContext;\nimport javax.ws.rs.container.ContainerResponseContext;\nimport javax.ws.rs.container.ContainerResponseFilter;\nimport javax.ws.rs.core.MultivaluedMap;\nimport javax.ws.rs.ext.Provider;\n\n@Provider\n@Priority(Priorities.HEADER_DECORATOR)\npublic class CORSResponseFilter implements ContainerResponseFilter {\n\t\n\t@Override\n\tpublic void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {\t\t\t\n\t\t \n\t\tMultivaluedMap headers = responseContext.getHeaders();\n \n\t\t\/\/headers.add(\"Access-Control-Allow-Origin\", \"*\");\n\t\theaders.add(\"Access-Control-Allow-Origin\", requestContext.getHeaderString(\"origin\"));\t\t\n\t\theaders.add(\"Access-Control-Allow-Methods\", \"GET, POST, DELETE, PUT\");\t\t\t\n\t\theaders.add(\"Access-Control-Allow-Headers\", \"authorization, content-type\"); \/\/ request\n\t\theaders.add(\"Access-Control-Expose-Headers\", \"location\"); \/\/ response\n\t\theaders.add(\"Access-Control-Allow-Credentials\", \"true\");\n\t\theaders.add(\"Access-Control-Max-Age\", \"1728000\"); \/\/ in seconds, 20 days\n\t\t\/\/headers.add(\"Access-Control-Max-Age\", \"1\"); \/\/ makes debugging easier\t\t\t\n\t}\n}","new_contents":"package fi.csc.chipster.rest;\n\nimport java.io.IOException;\n\nimport javax.annotation.Priority;\nimport javax.ws.rs.Priorities;\nimport javax.ws.rs.container.ContainerRequestContext;\nimport javax.ws.rs.container.ContainerResponseContext;\nimport javax.ws.rs.container.ContainerResponseFilter;\nimport javax.ws.rs.core.MultivaluedMap;\nimport javax.ws.rs.ext.Provider;\n\n@Provider\n@Priority(Priorities.HEADER_DECORATOR)\npublic class CORSResponseFilter implements ContainerResponseFilter {\n\t\n\t@Override\n\tpublic void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {\t\t\t\n\t\t \n\t\tMultivaluedMap headers = responseContext.getHeaders();\n \n\t\t\/\/headers.add(\"Access-Control-Allow-Origin\", \"*\");\n\t\theaders.add(\"Access-Control-Allow-Origin\", requestContext.getHeaderString(\"origin\"));\t\t\n\t\theaders.add(\"Access-Control-Allow-Methods\", \"GET, POST, DELETE, PUT\");\t\t\t\n\t\theaders.add(\"Access-Control-Allow-Headers\", \"authorization, content-type\"); \/\/ request\n\t\theaders.add(\"Access-Control-Expose-Headers\", \"location, Accept-Ranges\"); \/\/ response\n\t\theaders.add(\"Access-Control-Allow-Credentials\", \"true\");\n\t\theaders.add(\"Access-Control-Max-Age\", \"1728000\"); \/\/ in seconds, 20 days\n\t\t\/\/headers.add(\"Access-Control-Max-Age\", \"1\"); \/\/ makes debugging easier\t\t\t\n\t}\n}","subject":"Allow browser to get accept-ranges header"}
      {"old_contents":"package me.duncte123.skybot.utils;\n\nimport net.dv8tion.jda.core.events.message.MessageReceivedEvent;\n\nimport java.util.Arrays;\n\n\npublic class CommandParser {\n\n    public CommandContainer parse(String rw, MessageReceivedEvent e){\n        final String[] split = rw.substring(rw.indexOf(Config.prefix) + 1, rw.length()).split(\" \");\n        final String invoke = split[0];\n        final String[] args = Arrays.copyOfRange(split, 1, split.length);\n\n        return new CommandContainer(invoke, args, e);\n    }\n\n     public class CommandContainer {\n         public final String invoke;\n         public final String[] args;\n         public final MessageReceivedEvent event;\n\n         public CommandContainer(String invoke, String[] args, MessageReceivedEvent e){\n             this.invoke = invoke;\n             this.args = args;\n             this.event = e;\n         }\n     }\n\n}\n","new_contents":"package me.duncte123.skybot.utils;\n\nimport net.dv8tion.jda.core.events.message.MessageReceivedEvent;\n\nimport java.util.Arrays;\n\n\npublic class CommandParser {\n\n    public CommandContainer parse(String rw, MessageReceivedEvent e){\n        final String[] split = rw.substring(rw.indexOf(Config.prefix) + 1, rw.length()).split(\" \");\n        final String invoke = split[0].toLowerCase();\n        final String[] args = Arrays.copyOfRange(split, 1, split.length);\n\n        return new CommandContainer(invoke, args, e);\n    }\n\n     public class CommandContainer {\n         public final String invoke;\n         public final String[] args;\n         public final MessageReceivedEvent event;\n\n         public CommandContainer(String invoke, String[] args, MessageReceivedEvent e){\n             this.invoke = invoke;\n             this.args = args;\n             this.event = e;\n         }\n     }\n\n}\n","subject":"Make the called command to lowercase"}
      {"old_contents":"import javax.swing.JFrame;\n\/*Author: Peter Chow\n * \n * \n * SudokuCapture will capture images from a webcam, \n * using still image capture from the video, another thread will approximate the bounds of the board\n * and try to scan in the values of the board for the program to use.\n * After a successful scan, the program will solve the board and display the answer using an overlay over the camera view\n * \n * *\/\n\npublic class SudokuCapture {\n\t\n\tpublic static void main (String args[]){\n\t\tinit();\n\t\tCaptureWebcam webcam = new CaptureWebcam();\n\t\twebcam.display();\n\t}\n\t\n\tprivate static void init() {\n\t\tSystem.out.println(\"start\");\n\t\tString answer = System.getProperty(\"sun.arch.data.model\");\n\t\tif(answer.matches(\"64\")){\n\t\t\tSystem.loadLibrary(\".\/build\/x64\/opencv_java300\");\n\t\t}else if(answer.matches(\"32\")){\n\t\t\tSystem.loadLibrary(\".\/build\/x86\/opencv_java300\");\n\t\t}else{\n\t\t\tSystem.err.println(\"Your platform is not comptable\");\n\t\t\tSystem.exit(0);\n\t\t}\t\t\n\t}\n\n}\n","new_contents":"\/*Author: Peter Chow\n * \n * \n * SudokuCapture will capture images from a webcam, \n * using still image capture from the video, another thread will approximate the bounds of the board\n * and try to scan in the values of the board for the program to use.\n * After a successful scan, the program will solve the board and display the answer using an overlay over the camera view\n * \n * *\/\n\npublic class SudokuCapture {\n\t\n\tpublic static void main (String args[]){\n\t\tinit();\n\t\tCaptureWebcam webcam = new CaptureWebcam();\n\t\twebcam.display();\n\t}\n\t\n\t\/\/Load up OpenCV lib by checking if the machine is 64-bit or 32-bit\n\tprivate static void init() {\n\t\tSystem.out.println(\"starting webcam capture\");\n\t\tString answer = System.getProperty(\"sun.arch.data.model\");\n\t\tif(answer.matches(\"64\"))\n\t\t{\n\t\t\tSystem.loadLibrary(\".\/build\/x64\/opencv_java300\");\n\t\t}\n\t\telse if(answer.matches(\"32\"))\n\t\t{\n\t\t\tSystem.loadLibrary(\".\/build\/x86\/opencv_java300\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.err.println(\"Your platform is not comptable\");\n\t\t\tSystem.exit(0);\n\t\t}\t\t\n\t}\n\n}\n","subject":"Refactor code and added new comments"}
      {"old_contents":"package org.gem.log;\n\nimport org.apache.log4j.BasicConfigurator;\nimport org.apache.log4j.Logger;\nimport org.apache.log4j.PatternLayout;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertThat;\n\nimport static org.junit.matchers.JUnitMatchers.*;\n\nimport static org.hamcrest.CoreMatchers.*;\n\npublic class AMQPAppenderTest {\n    private DummyChannel dummyChannel;\n    private DummyAppender dummyAppender;\n    private Logger logger = Logger.getLogger(AMQPAppenderTest.class);\n\n    void tearDown() {\n        dummyChannel = null;\n        dummyAppender = null;\n\n        \/\/ this closes the RabbitMQ connections\n        BasicConfigurator.resetConfiguration();\n    }\n\n    private void setUpDummyAppender() {\n        dummyAppender = new DummyAppender();\n        dummyAppender.setLayout(new PatternLayout());\n\n        BasicConfigurator.configure(dummyAppender);\n    }\n\n    @Test\n    public void basicLogging() {\n        setUpDummyAppender();\n\n        logger.info(\"Test\");\n\n        dummyChannel = (DummyChannel) dummyAppender.getChannel();\n\n        assertThat(dummyChannel.entries.size(), is(equalTo(1)));\n\n        DummyChannel.Entry entry = dummyChannel.entries.get(0);\n\n        assertThat(entry.exchange, is(equalTo(\"\")));\n        assertThat(entry.routingKey, is(equalTo(\"\")));\n        assertThat(entry.properties.getType(), is(equalTo(\"INFO\")));\n        assertThat(entry.body, is(equalTo(\"Test\\n\")));\n    }\n}\n","new_contents":"package org.gem.log;\n\nimport org.apache.log4j.BasicConfigurator;\nimport org.apache.log4j.Logger;\nimport org.apache.log4j.PatternLayout;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertThat;\n\nimport static org.junit.matchers.JUnitMatchers.*;\n\nimport static org.hamcrest.CoreMatchers.*;\n\npublic class AMQPAppenderTest {\n    private DummyChannel dummyChannel;\n    private DummyAppender dummyAppender;\n    private Logger logger = Logger.getLogger(AMQPAppenderTest.class);\n\n    void tearDown() {\n        dummyChannel = null;\n        dummyAppender = null;\n\n        \/\/ this closes the RabbitMQ connections\n        BasicConfigurator.resetConfiguration();\n    }\n\n    private void setUpDummyAppender() {\n        dummyAppender = new DummyAppender();\n        dummyAppender.setLayout(new PatternLayout());\n\n        BasicConfigurator.configure(dummyAppender);\n    }\n\n    @Test\n    public void basicLogging() {\n        setUpDummyAppender();\n\n        logger.info(\"Test1\");\n        logger.warn(\"Test2\");\n\n        dummyChannel = (DummyChannel) dummyAppender.getChannel();\n\n        assertThat(dummyChannel.entries.size(), is(equalTo(2)));\n\n        DummyChannel.Entry entry1 = dummyChannel.entries.get(0);\n\n        assertThat(entry1.exchange, is(equalTo(\"\")));\n        assertThat(entry1.routingKey, is(equalTo(\"\")));\n        assertThat(entry1.properties.getType(), is(equalTo(\"INFO\")));\n        assertThat(entry1.body, is(equalTo(\"Test1\\n\")));\n\n        DummyChannel.Entry entry2 = dummyChannel.entries.get(1);\n\n        assertThat(entry2.exchange, is(equalTo(\"\")));\n        assertThat(entry2.routingKey, is(equalTo(\"\")));\n        assertThat(entry2.properties.getType(), is(equalTo(\"WARN\")));\n        assertThat(entry2.body, is(equalTo(\"Test2\\n\")));\n    }\n}\n","subject":"Test that .info() and .warn() set the correct event type."}
      {"old_contents":"package mezz.jei.plugins.vanilla.furnace;\r\n\r\nimport javax.annotation.Nonnull;\r\nimport javax.annotation.Nullable;\r\nimport java.awt.Color;\r\nimport java.util.ArrayList;\r\nimport java.util.Collection;\r\nimport java.util.Collections;\r\nimport java.util.List;\r\n\r\nimport net.minecraft.client.Minecraft;\r\nimport net.minecraft.item.ItemStack;\r\n\r\nimport mezz.jei.plugins.vanilla.VanillaRecipeWrapper;\r\nimport mezz.jei.util.Translator;\r\n\r\npublic class FuelRecipe extends VanillaRecipeWrapper {\r\n\t@Nonnull\r\n\tprivate final List input;\r\n\t@Nullable\r\n\tprivate final String burnTimeString;\r\n\r\n\tpublic FuelRecipe(@Nonnull Collection input, int burnTime) {\r\n\t\tthis.input = new ArrayList<>(input);\r\n\t\tthis.burnTimeString = Translator.translateToLocalFormatted(\"gui.jei.furnaceBurnTime\", burnTime);\r\n\t}\r\n\r\n\t@Nonnull\r\n\t@Override\r\n\tpublic List getInputs() {\r\n\t\treturn input;\r\n\t}\r\n\r\n\t@Nonnull\r\n\t@Override\r\n\tpublic List getOutputs() {\r\n\t\treturn Collections.emptyList();\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {\r\n\t\tminecraft.fontRendererObj.drawString(burnTimeString, 24, 12, Color.gray.getRGB());\r\n\t}\r\n}\r\n","new_contents":"package mezz.jei.plugins.vanilla.furnace;\r\n\r\nimport javax.annotation.Nonnull;\r\nimport javax.annotation.Nullable;\r\nimport java.awt.Color;\r\nimport java.util.ArrayList;\r\nimport java.util.Collection;\r\nimport java.util.Collections;\r\nimport java.util.List;\r\n\r\nimport net.minecraft.client.Minecraft;\r\nimport net.minecraft.item.ItemStack;\r\n\r\nimport mezz.jei.plugins.vanilla.VanillaRecipeWrapper;\r\nimport mezz.jei.util.Translator;\r\n\r\npublic class FuelRecipe extends VanillaRecipeWrapper {\r\n\t@Nonnull\r\n\tprivate final List> inputs;\r\n\t@Nonnull\r\n\tprivate final String burnTimeString;\r\n\r\n\tpublic FuelRecipe(@Nonnull Collection input, int burnTime) {\r\n\t\tthis.inputs = Collections.singletonList(new ArrayList<>(input));\r\n\t\tthis.burnTimeString = Translator.translateToLocalFormatted(\"gui.jei.furnaceBurnTime\", burnTime);\r\n\t}\r\n\r\n\t@Nonnull\r\n\t@Override\r\n\tpublic List> getInputs() {\r\n\t\treturn inputs;\r\n\t}\r\n\r\n\t@Nonnull\r\n\t@Override\r\n\tpublic List getOutputs() {\r\n\t\treturn Collections.emptyList();\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {\r\n\t\tminecraft.fontRendererObj.drawString(burnTimeString, 24, 12, Color.gray.getRGB());\r\n\t}\r\n}\r\n","subject":"Fix fuel recipe transfer helper"}
      {"old_contents":"\/*-------------------------------------------------------------------------\n*\n* Copyright (c) 2004-2005, PostgreSQL Global Development Group\n*\n* IDENTIFICATION\n*   $PostgreSQL: pgjdbc\/org\/postgresql\/util\/PSQLDriverVersion.java,v 1.21 2006\/12\/01 12:06:21 jurka Exp $\n*\n*-------------------------------------------------------------------------\n*\/\npackage org.postgresql.util;\n\nimport org.postgresql.Driver;\n\n\/**\n * This class holds the current build number and a utility program to print\n * it and the file it came from.  The primary purpose of this is to keep\n * from filling the cvs history of Driver.java.in with commits simply\n * changing the build number.  The utility program can also be helpful for\n * people to determine what version they really have and resolve problems\n * with old and unknown versions located somewhere in the classpath.\n *\/\npublic class PSQLDriverVersion {\n\n    public final static int buildNumber = 601;\n\n    public static void main(String args[]) {\n        java.net.URL url = Driver.class.getResource(\"\/org\/postgresql\/Driver.class\");\n        System.out.println(Driver.getVersion());\n        System.out.println(\"Found in: \" + url);\n    }\n\n}\n","new_contents":"\/*-------------------------------------------------------------------------\n*\n* Copyright (c) 2004-2005, PostgreSQL Global Development Group\n*\n* IDENTIFICATION\n*   $PostgreSQL: pgjdbc\/org\/postgresql\/util\/PSQLDriverVersion.java,v 1.22 2007\/07\/31 06:05:43 jurka Exp $\n*\n*-------------------------------------------------------------------------\n*\/\npackage org.postgresql.util;\n\nimport org.postgresql.Driver;\n\n\/**\n * This class holds the current build number and a utility program to print\n * it and the file it came from.  The primary purpose of this is to keep\n * from filling the cvs history of Driver.java.in with commits simply\n * changing the build number.  The utility program can also be helpful for\n * people to determine what version they really have and resolve problems\n * with old and unknown versions located somewhere in the classpath.\n *\/\npublic class PSQLDriverVersion {\n\n    public final static int buildNumber = 602;\n\n    public static void main(String args[]) {\n        java.net.URL url = Driver.class.getResource(\"\/org\/postgresql\/Driver.class\");\n        System.out.println(Driver.getVersion());\n        System.out.println(\"Found in: \" + url);\n    }\n\n}\n","subject":"Prepare for release of 8.3dev-602."}
      {"old_contents":"\/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage tw.edu.npu.mis;\n\n\/**\n * The model class of the calculator application.\n *\/\npublic class Calculator {\n    \n    \/**\n     * The available operators of the calculator.\n     *\/\n    public enum Operator {\n        CLEAR,       \/\/ C\n        CLEAR_ENTRY, \/\/ CE\n        BACKSPACE,   \/\/ ⌫\n        EQUAL,       \/\/ =\n        PLUS,        \/\/ +\n        MINUS,       \/\/ -\n        TIMES,       \/\/ ×\n        OVER,        \/\/ ⁄\n        PLUS_MINUS,  \/\/ ±\n        RECIPROCAL,  \/\/ 1\/x\n        PERCENT,     \/\/ %\n        SQRT,        \/\/ √\n        MEM_CLEAR,   \/\/ MC\n        MEM_SET,     \/\/ MS\n        MEM_PLUS,    \/\/ M+\n        MEM_MINUS,   \/\/ M-\n        MEM_RECALL   \/\/ MR\n    }\n    \n    public void appendDigit(int digit) {\n        \/\/ TODO code application logic here\n    }\n    \n    public void appendDot() {\n        \/\/ TODO code application logic here\n    }\n    \n    public void performOperation(Operator operator) {\n        \/\/ TODO code application logic here\n    }\n    \n    public String getDisplay() {\n        \/\/ TODO code application logic here\n        return null;\n    }\n\n    \/**\n     * @param args the command line arguments\n     *\/\n    public static void main(String[] args) {\n        \/\/ TODO code application logic here\n    }\n\n}\n","new_contents":"\/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor.\n *\/\npackage tw.edu.npu.mis;\n\n\/**\n * The model class of the calculator application.\n *\/\npublic class Calculator {\n    \n    \/**\n     * The available operators of the calculator.\n     *\/\n    public enum Operator {\n        EQUAL,       \/\/ =\n        PLUS,        \/\/ +\n        MINUS,       \/\/ -\n        TIMES,       \/\/ ×\n        OVER,        \/\/ ⁄\n        PLUS_MINUS,  \/\/ ±\n        RECIPROCAL,  \/\/ 1\/x\n        PERCENT,     \/\/ %\n        SQRT,        \/\/ √\n        BACKSPACE,   \/\/ ⌫\n        CLEAR,       \/\/ C\n        CLEAR_ENTRY, \/\/ CE\n        MEM_SET,     \/\/ MS\n        MEM_PLUS,    \/\/ M+\n        MEM_MINUS,   \/\/ M-\n        MEM_RECALL,  \/\/ MR\n        MEM_CLEAR    \/\/ MC\n    }\n    \n    public void appendDigit(int digit) {\n        \/\/ TODO code application logic here\n    }\n    \n    public void appendDot() {\n        \/\/ TODO code application logic here\n    }\n    \n    public void performOperation(Operator operator) {\n        \/\/ TODO code application logic here\n    }\n    \n    public String getDisplay() {\n        \/\/ TODO code application logic here\n        return null;\n    }\n\n    \/**\n     * @param args the command line arguments\n     *\/\n    public static void main(String[] args) {\n        \/\/ TODO code application logic here\n    }\n\n}\n","subject":"Revert \"Revert \"Revert \"Reorder operator\"\"\""}
      {"old_contents":"package devopsdistilled.operp.client;\n\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.annotation.AnnotationConfigApplicationContext;\n\nimport devopsdistilled.operp.client.context.AppContext;\nimport devopsdistilled.operp.client.main.MainWindow;\n\npublic class ClientApp {\n\tpublic static void main(String[] args) {\n\t\tApplicationContext context = new AnnotationConfigApplicationContext(\n\t\t\t\tAppContext.class);\n\n\t\tMainWindow window = context.getBean(MainWindow.class);\n\t\twindow.init();\n\n\t\tSystem.out.println(context);\n\t}\n}\n","new_contents":"package devopsdistilled.operp.client;\n\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.annotation.AnnotationConfigApplicationContext;\n\nimport devopsdistilled.operp.client.context.AppContext;\nimport devopsdistilled.operp.client.main.MainWindow;\n\npublic class ClientApp {\n\n\tprivate static ApplicationContext context;\n\n\tpublic static ApplicationContext getApplicationContext() {\n\t\treturn context;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tcontext = new AnnotationConfigApplicationContext(AppContext.class);\n\n\t\tMainWindow window = context.getBean(MainWindow.class);\n\t\twindow.init();\n\n\t\tSystem.out.println(context);\n\t}\n}\n","subject":"Create static instance of ApplicationContext for global reference"}
      {"old_contents":"package org.graphstream.gama.extension;\n\nimport msi.gama.common.interfaces.IKeyword;\n\npublic class IKeywordGSAdditional implements IKeyword {\n\t\/\/ New commands\n\t\n\tpublic static final String ADD = \"gs_add\";\n\tpublic static final String ADD_ATTRIBUTE = \"gs_add_attribute\";\n\tpublic static final String ADD_SENDER = \"gs_add_sender\";\n\tpublic static final String CLEAR = \"gs_clear\";\n\tpublic static final String CLEAR_SENDERS = \"gs_clear_senders\";\n\tpublic static final String REMOVE = \"gs_remove\";\n\tpublic static final String REMOVE_ATTRIBUTE = \"gs_remove_attribute\";\n\tpublic static final String STEP = \"gs_step\";\n\t\n\t\/\/ Facets associated to a command\n\t\n\tpublic static final String SENDERID = \"gs_sender_id\";\n}\n","new_contents":"package org.graphstream.gama.extension;\n\nimport msi.gama.common.interfaces.IKeyword;\n\npublic class IKeywordGSAdditional implements IKeyword {\n\t\/\/ New commands\n\t\n\tpublic static final String ADD = \"gs_add\";\n\tpublic static final String ADD_ATTRIBUTE = \"gs_add_attribute\";\n\tpublic static final String ADD_SENDER = \"gs_add_sender\";\n\tpublic static final String CLEAR = \"gs_clear\";\n\tpublic static final String CLEAR_SENDERS = \"gs_clear_senders\";\n\tpublic static final String REMOVE = \"gs_remove\";\n\tpublic static final String REMOVE_ATTRIBUTE = \"gs_remove_attribute\";\n\tpublic static final String STEP = \"gs_step\";\n\t\n\t\/\/ Facets associated to a command\n\t\n\tpublic static final String SENDERID = \"gs_sender_id\";\n\tpublic static final String STEP_NUMBER = \"gs_step_number\";\n\t\n}\n","subject":"Add new facet for 'step' command"}
      {"old_contents":"\/\/ Copyright (c) 2009 The Chromium Authors. All rights reserved.\n\/\/ Use of this source code is governed by a BSD-style license that can be\n\/\/ found in the LICENSE file.\n\npackage org.chromium.sdk;\n\nimport java.io.IOException;\n\nimport org.chromium.sdk.util.MethodIsBlockingException;\n\n\/**\n * Abstraction of a remote JavaScript virtual machine which is embedded into\n * some application and accessed via TCP\/IP connection to a port opened by\n * DebuggerAgent. Clients can use it to conduct debugging process.\n *\/\npublic interface StandaloneVm extends JavascriptVm {\n  \/**\n   * Connects to the target VM.\n   *\n   * @param listener to report the debug events to\n   * @throws IOException if there was a transport layer error\n   * @throws UnsupportedVersionException if the SDK protocol version is not\n   *         compatible with that supported by the browser\n     * @throws MethodIsBlockingException because initialization implies couple of remote calls\n     *     (to request version etc)\n   *\/\n  void attach(DebugEventListener listener)\n      throws IOException, UnsupportedVersionException, MethodIsBlockingException;\n\n  \/**\n   * @return name of embedding application as it wished to name itself; might be null\n   *\/\n  String getEmbedderName();\n\n  \/**\n   * @return version of V8 implementation, format is unspecified; must not be null if\n   *         {@link StandaloneVm} has been attached\n   *\/\n  \/\/ TODO: align this with {@link JavascriptVm#getVersion()} method.\n  String getVmVersion();\n\n  \/**\n   * @return message explaining why VM is detached; may be null\n   *\/\n  String getDisconnectReason();\n}\n","new_contents":"\/\/ Copyright (c) 2009 The Chromium Authors. All rights reserved.\n\/\/ Use of this source code is governed by a BSD-style license that can be\n\/\/ found in the LICENSE file.\n\npackage org.chromium.sdk;\n\nimport java.io.IOException;\n\nimport org.chromium.sdk.util.MethodIsBlockingException;\n\n\/**\n * Abstraction of a remote JavaScript virtual machine which is embedded into\n * some application and accessed via TCP\/IP connection to a port opened by\n * DebuggerAgent. Clients can use it to conduct debugging process.\n *\/\npublic interface StandaloneVm extends JavascriptVm {\n  \/**\n   * Connects to the target VM.\n   *\n   * @param listener to report the debug events to\n   * @throws IOException if there was a transport layer error\n   * @throws UnsupportedVersionException if the SDK protocol version is not\n   *         compatible with that supported by the browser\n     * @throws MethodIsBlockingException because initialization implies couple of remote calls\n     *     (to request version etc)\n   *\/\n  void attach(DebugEventListener listener)\n      throws IOException, UnsupportedVersionException, MethodIsBlockingException;\n\n  \/**\n   * @return name of embedding application as it wished to name itself; might be null\n   *\/\n  String getEmbedderName();\n\n  \/**\n   * This version should correspond to {@link JavascriptVm#getVersion()}. However it gets available\n   * earlier, at the transport handshake stage.\n   * @return version of V8 implementation, format is unspecified; must not be null if\n   *         {@link StandaloneVm} has been attached\n   *\/\n  String getVmVersion();\n\n  \/**\n   * @return message explaining why VM is detached; may be null\n   *\/\n  String getDisconnectReason();\n}\n","subject":"Drop TODO for getVmVersion method"}
      {"old_contents":"package com.nostra13.universalimageloader.cache;\n\nimport java.lang.ref.Reference;\nimport java.lang.ref.SoftReference;\n\nimport android.graphics.Bitmap;\n\n\/**\n * Image cache limited by size. Contains Bitmaps.
      \n * Not thread-safe.\n * \n * @author Sergey Tarasevich (nostra13[at]gmail[dot]com)\n *\/\npublic class ImageCache extends LimitedCache {\n\n\tprivate int sizeLimit;\n\n\tpublic ImageCache(int sizeLimit) {\n\t\tthis.sizeLimit = sizeLimit;\n\t}\n\n\t@Override\n\tprotected int getSize(Bitmap value) {\n\t\treturn value.getRowBytes() * value.getHeight();\n\t}\n\n\t@Override\n\tprotected int getSizeLimit() {\n\t\treturn sizeLimit;\n\t}\n\n\t@Override\n\tprotected Reference createReference(Bitmap value) {\n\t\treturn new SoftReference(value);\n\t}\n}\n","new_contents":"package com.nostra13.universalimageloader.cache;\n\nimport java.lang.ref.Reference;\nimport java.lang.ref.WeakReference;\n\nimport android.graphics.Bitmap;\n\n\/**\n * Image cache limited by size. Contains Bitmaps.
      \n * Not thread-safe.\n * \n * @author Sergey Tarasevich (nostra13[at]gmail[dot]com)\n *\/\npublic class ImageCache extends LimitedCache {\n\n\tprivate int sizeLimit;\n\n\tpublic ImageCache(int sizeLimit) {\n\t\tthis.sizeLimit = sizeLimit;\n\t}\n\n\t@Override\n\tprotected int getSize(Bitmap value) {\n\t\treturn value.getRowBytes() * value.getHeight();\n\t}\n\n\t@Override\n\tprotected int getSizeLimit() {\n\t\treturn sizeLimit;\n\t}\n\n\t@Override\n\tprotected Reference createReference(Bitmap value) {\n\t\treturn new WeakReference(value);\n\t}\n}\n","subject":"Return mistakenly replaced weak reference"} {"old_contents":"package com.tom_e_white.chickenalerts;\n\nimport android.app.Notification;\nimport android.app.NotificationManager;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.media.MediaPlayer;\n\npublic class ChickenAlertReceiver extends BroadcastReceiver {\n\t@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tNotification notification = new Notification.Builder(context)\n\t\t\t\t.setContentTitle(\"Chicken Alert\")\n\t\t\t\t.setContentText(\"Have you put the chickens to bed?\")\n\t\t\t\t.setTicker(\"Have you put the chickens to bed?\")\n\t\t\t\t.setSmallIcon(R.drawable.ic_launcher).build();\n\t\tnotification.flags |= Notification.FLAG_AUTO_CANCEL;\n\t\tNotificationManager notificationManager = (NotificationManager) context\n\t\t\t\t.getSystemService(Context.NOTIFICATION_SERVICE);\n\t\tnotificationManager.notify(0, notification);\n\t\t\n\t\tMediaPlayer mediaPlayer = MediaPlayer.create(context, R.raw.cluck);\n\t\tmediaPlayer.start(); \/\/ no need to call prepare(); create() does that for you\n\t}\n\n}","new_contents":"package com.tom_e_white.chickenalerts;\n\nimport android.app.Notification;\nimport android.app.NotificationManager;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.media.MediaPlayer;\nimport android.media.MediaPlayer.OnCompletionListener;\n\npublic class ChickenAlertReceiver extends BroadcastReceiver {\n\t@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tNotification notification = new Notification.Builder(context)\n\t\t\t\t.setContentTitle(\"Chicken Alert\")\n\t\t\t\t.setContentText(\"Have you put the chickens to bed?\")\n\t\t\t\t.setTicker(\"Have you put the chickens to bed?\")\n\t\t\t\t.setSmallIcon(R.drawable.ic_launcher).build();\n\t\tnotification.flags |= Notification.FLAG_AUTO_CANCEL;\n\t\tNotificationManager notificationManager = (NotificationManager) context\n\t\t\t\t.getSystemService(Context.NOTIFICATION_SERVICE);\n\t\tnotificationManager.notify(0, notification);\n\t\t\n\t\tMediaPlayer mediaPlayer = MediaPlayer.create(context, R.raw.cluck);\n\t\tmediaPlayer.start();\n\t\tmediaPlayer.setOnCompletionListener(new OnCompletionListener() {\n\t @Override\n\t public void onCompletion(MediaPlayer mp) {\n\t mp.release(); \n\t }\n\t });\n\t}\n\n}","subject":"Stop media player after sound."} {"old_contents":"package com.github.xetorthio.jedisque;\n\nimport java.net.URI;\nimport java.net.URISyntaxException;\n\nimport org.junit.Test;\n\nimport redis.clients.jedis.exceptions.JedisConnectionException;\n\npublic class ConnectionTest {\n\t@Test\n\tpublic void iterateOverHosts() throws URISyntaxException {\n\t\ttry (Jedisque q = new Jedisque(new URI(\"disque:\/\/localhost:55665\"),\n\t\t\t\tnew URI(\"disque:\/\/localhost:7711\"))) {\n\t\t\tq.info();\n\t\t}\n\t}\n\n\t@Test(expected = JedisConnectionException.class)\n\tpublic void throwExceptionWhenNodesAreUnavailbale()\n\t\t\tthrows URISyntaxException {\n\t\ttry (Jedisque q = new Jedisque(new URI(\"disque:\/\/localhost:55665\"),\n\t\t\t\tnew URI(\"disque:\/\/localhost:55666\"))) {\n\t\t\tq.info();\n\t\t}\n\t}\n}\n","new_contents":"package com.github.xetorthio.jedisque;\n\nimport java.net.URI;\nimport java.net.URISyntaxException;\n\nimport org.junit.Test;\n\nimport redis.clients.jedis.exceptions.JedisConnectionException;\n\npublic class ConnectionTest {\n\n\t@Test\n\tpublic void iterateOverHosts() throws URISyntaxException {\n\t\tJedisque q = new Jedisque(new URI(\"disque:\/\/localhost:55665\"), new URI(\"disque:\/\/localhost:7711\"));\n\t\tq.info();\n\t\tq.close();\n\n\t}\n\n\t@Test(expected = JedisConnectionException.class)\n\tpublic void throwExceptionWhenNodesAreUnavailbale() throws URISyntaxException {\n\t\tJedisque q = new Jedisque(new URI(\"disque:\/\/localhost:55665\"), new URI(\"disque:\/\/localhost:55666\"));\n\t\tq.info();\n\t\tq.close();\n\t}\n}\n","subject":"Change test strategy in favor of simple testing Update project source to 1.6"} {"old_contents":"package xyz.pushpad;\n\nimport javax.crypto.spec.SecretKeySpec;\nimport javax.crypto.Mac;\nimport java.security.SignatureException;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.InvalidKeyException;\nimport javax.xml.bind.DatatypeConverter;\n\npublic class Pushpad {\n public String authToken;\n public String projectId;\n\n public Pushpad(String authToken, String projectId) {\n this.authToken = authToken;\n this.projectId = projectId;\n }\n\n public String signatureFor(String data) {\n SecretKeySpec signingKey = new SecretKeySpec(this.authToken.getBytes(), \"HmacSHA1\");\n String encoded = null;\n try {\n Mac mac = Mac.getInstance(\"HmacSHA1\");\n mac.init(signingKey);\n byte[] rawHmac = mac.doFinal(data.getBytes());\n encoded = DatatypeConverter.printHexBinary(rawHmac);\n } catch (NoSuchAlgorithmException | InvalidKeyException e) { \n e.printStackTrace();\n }\n\n return encoded;\n }\n\n public String path() {\n return \"https:\/\/pushpad.xyz\/projects\/\" + this.projectId + \"\/subscription\/edit\";\n }\n\n public String pathFor(String uid) {\n String uidSignature = this.signatureFor(uid);\n return this.path() + \"?uid=\" + uid + \"&uid_signature=\" + uidSignature;\n }\n\n public Notification buildNotification(String title, String body, String targetUrl) {\n return new Notification(this, title, body, targetUrl);\n }\n}\n","new_contents":"package xyz.pushpad;\n\nimport javax.crypto.spec.SecretKeySpec;\nimport javax.crypto.Mac;\nimport java.security.SignatureException;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.InvalidKeyException;\nimport javax.xml.bind.DatatypeConverter;\n\npublic class Pushpad {\n public String authToken;\n public String projectId;\n\n public Pushpad(String authToken, String projectId) {\n this.authToken = authToken;\n this.projectId = projectId;\n }\n\n public String signatureFor(String data) {\n SecretKeySpec signingKey = new SecretKeySpec(this.authToken.getBytes(), \"HmacSHA1\");\n String encoded = null;\n try {\n Mac mac = Mac.getInstance(\"HmacSHA1\");\n mac.init(signingKey);\n byte[] rawHmac = mac.doFinal(data.getBytes());\n encoded = DatatypeConverter.printHexBinary(rawHmac).toLowerCase();\n } catch (NoSuchAlgorithmException | InvalidKeyException e) { \n e.printStackTrace();\n }\n\n return encoded;\n }\n\n public String path() {\n return \"https:\/\/pushpad.xyz\/projects\/\" + this.projectId + \"\/subscription\/edit\";\n }\n\n public String pathFor(String uid) {\n String uidSignature = this.signatureFor(uid);\n return this.path() + \"?uid=\" + uid + \"&uid_signature=\" + uidSignature;\n }\n\n public Notification buildNotification(String title, String body, String targetUrl) {\n return new Notification(this, title, body, targetUrl);\n }\n}\n","subject":"Convert HMAC-SHA1 signatures to lower case"} {"old_contents":"package org.blaazinsoftware.centaur.service;\n\nimport com.google.appengine.api.search.Cursor;\nimport com.google.appengine.api.search.OperationResult;\nimport com.google.appengine.api.search.checkers.Preconditions;\n\nimport java.io.Serializable;\nimport java.util.Collection;\nimport java.util.Collections;\n\n\/**\n * @author Randy May\n * Date: 15-04-09\n *\/\npublic class SearchResults implements Serializable {\n\n private final OperationResult operationResult;\n private final Collection results;\n private final long numberFound;\n private final int numberReturned;\n private final Cursor cursor;\n\n protected SearchResults(OperationResult operationResult, Collection results, long numberFound, int numberReturned, Cursor cursor) {\n this.operationResult = (OperationResult) Preconditions.checkNotNull(operationResult, \"operation result cannot be null\");\n this.results = Collections.unmodifiableCollection((Collection) Preconditions.checkNotNull(results, \"search results cannot be null\"));\n this.numberFound = numberFound;\n this.numberReturned = numberReturned;\n this.cursor = cursor;\n }\n\n public OperationResult getOperationResult() {\n return operationResult;\n }\n\n public Collection getResults() {\n return results;\n }\n\n public long getNumberFound() {\n return numberFound;\n }\n\n public int getNumberReturned() {\n return numberReturned;\n }\n\n public Cursor getCursor() {\n return cursor;\n }\n}\n","new_contents":"package org.blaazinsoftware.centaur.service;\n\nimport com.google.appengine.api.search.Cursor;\nimport com.google.appengine.api.search.OperationResult;\n\nimport java.io.Serializable;\nimport java.util.Collection;\n\n\/**\n * @author Randy May\n * Date: 15-04-09\n *\/\npublic class SearchResults implements Serializable {\n\n private final OperationResult operationResult;\n private final Collection results;\n private final long numberFound;\n private final int numberReturned;\n private final Cursor cursor;\n\n protected SearchResults(OperationResult operationResult, Collection results, long numberFound, int numberReturned, Cursor cursor) {\n if (null == operationResult) {\n throw new NullPointerException(\"Operation Result cannot be null\");\n }\n this.operationResult = operationResult;\n if (null == results) {\n throw new NullPointerException(\"Search Results cannot be null\");\n }\n this.results = results;\n this.numberFound = numberFound;\n this.numberReturned = numberReturned;\n this.cursor = cursor;\n }\n\n public OperationResult getOperationResult() {\n return operationResult;\n }\n\n public Collection getResults() {\n return results;\n }\n\n public long getNumberFound() {\n return numberFound;\n }\n\n public int getNumberReturned() {\n return numberReturned;\n }\n\n public Cursor getCursor() {\n return cursor;\n }\n}\n","subject":"Remove usage of unsupported Class."} {"old_contents":"package edu.stuy.commands;\n\nimport edu.stuy.Robot;\nimport edu.wpi.first.wpilibj.command.Command;\n\n\/**\n *\n *\/\npublic class LiftControlCommand extends Command {\n\n public LiftControlCommand() {\n \/\/ Use requires() here to declare subsystem dependencies\n \/\/ eg. requires(chassis);\n requires(Robot.lift);\n }\n\n \/\/ Called just before this Command runs the first time\n protected void initialize() {\n }\n\n \/\/ Called repeatedly when this Command is scheduled to run\n protected void execute() {\n double input = squareInput(Robot.oi.operatorPad.getRightY());\n Robot.lift.manualControl(-input);\n }\n\n \/\/ Square the value of the input while preserving its sign\n private double squareInput(double input) {\n boolean negative = input < 0;\n input = input * input;\n if (negative) {\n input = -input;\n }\n return input;\n }\n\n \/\/ Make this return true when this Command no longer needs to run execute()\n protected boolean isFinished() {\n \/\/ This is the Lift's default command.\n return false;\n }\n\n \/\/ Called once after isFinished returns true\n protected void end() {\n }\n\n \/\/ Called when another command which requires one or more of the same\n \/\/ subsystems is scheduled to run\n protected void interrupted() {\n }\n}\n","new_contents":"package edu.stuy.commands;\n\nimport edu.stuy.Robot;\nimport edu.wpi.first.wpilibj.command.Command;\n\n\/**\n *\n *\/\npublic class LiftControlCommand extends Command {\n\n public LiftControlCommand() {\n \/\/ Use requires() here to declare subsystem dependencies\n \/\/ eg. requires(chassis);\n requires(Robot.lift);\n }\n\n \/\/ Called just before this Command runs the first time\n protected void initialize() {\n }\n\n \/\/ Called repeatedly when this Command is scheduled to run\n protected void execute() {\n double input = squareInput(Robot.oi.operatorPad.getRightY()) * 0.75;\n Robot.lift.manualControl(-input);\n }\n\n \/\/ Square the value of the input while preserving its sign\n private double squareInput(double input) {\n boolean negative = input < 0;\n input = input * input;\n if (negative) {\n input = -input;\n }\n return input;\n }\n\n \/\/ Make this return true when this Command no longer needs to run execute()\n protected boolean isFinished() {\n \/\/ This is the Lift's default command.\n return false;\n }\n\n \/\/ Called once after isFinished returns true\n protected void end() {\n }\n\n \/\/ Called when another command which requires one or more of the same\n \/\/ subsystems is scheduled to run\n protected void interrupted() {\n }\n}\n","subject":"Make lift manual control 75% speed"} {"old_contents":"package org.jongo;\n\nimport org.bson.types.ObjectId;\nimport org.jongo.model.Friend;\nimport org.jongo.util.JongoTestCase;\nimport org.jongo.util.MongoInMemoryRule;\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\n\nimport java.util.Iterator;\n\nimport static org.fest.assertions.Assertions.assertThat;\n\n\npublic class FindWithHintTest extends JongoTestCase {\n\n\n @Rule\n public static final MongoInMemoryRule mongo = new MongoInMemoryRule();\n\n private MongoCollection collection;\n\n @Before\n public void setUp() throws Exception {\n collection = createEmptyCollection(\"friends\");\n }\n\n @After\n public void tearDown() throws Exception {\n dropCollection(\"friends\");\n }\n\n @Test\n public void canFindWithHint() throws Exception {\n \/* given *\/\n Friend noName = new Friend(new ObjectId(), null);\n collection.save(noName);\n\n collection.ensureIndex(\"{name: 1}\", \"{sparse: true}\");\n\n \/* when *\/\n \/\/ force to use _id index instead of name index which is sparsed\n Iterator friends = collection.find().hint(\"{$natural: 1}\").sort(\"{name: 1}\").as(Friend.class).iterator();\n\n \/* then *\/\n assertThat(friends.hasNext()).isTrue();\n }\n\n}\n","new_contents":"package org.jongo;\n\nimport org.bson.types.ObjectId;\nimport org.jongo.model.Friend;\nimport org.jongo.util.JongoTestCase;\nimport org.jongo.util.MongoInMemoryRule;\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\n\nimport java.util.Iterator;\n\nimport static org.fest.assertions.Assertions.assertThat;\n\n\npublic class FindWithHintTest extends JongoTestCase {\n\n private MongoCollection collection;\n\n @Before\n public void setUp() throws Exception {\n collection = createEmptyCollection(\"friends\");\n }\n\n @After\n public void tearDown() throws Exception {\n dropCollection(\"friends\");\n }\n\n @Test\n public void canFindWithHint() throws Exception {\n \/* given *\/\n Friend noName = new Friend(new ObjectId(), null);\n collection.save(noName);\n\n collection.ensureIndex(\"{name: 1}\", \"{sparse: true}\");\n\n \/* when *\/\n \/\/ force to use _id index instead of name index which is sparsed\n Iterator friends = collection.find().hint(\"{$natural: 1}\").sort(\"{name: 1}\").as(Friend.class).iterator();\n\n \/* then *\/\n assertThat(friends.hasNext()).isTrue();\n }\n\n}\n","subject":"Remove in memory mongodb When running tests, it use the same port than real mongodb so it cause some tests issues if a read mongodb is running."} {"old_contents":"package fr.insee.pogues.transforms;\n\nimport org.apache.http.HttpResponse;\nimport org.apache.http.client.HttpClient;\nimport org.apache.http.client.methods.HttpPost;\nimport org.apache.http.entity.StringEntity;\nimport org.apache.http.util.EntityUtils;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.core.env.Environment;\nimport org.springframework.stereotype.Service;\n\nimport javax.annotation.PostConstruct;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Map;\n\n@Service\npublic class StromaeServiceImpl implements StromaeService {\n\n @Autowired\n Environment env;\n\n @Autowired\n HttpClient httpClient;\n\n private String serviceUri;\n\n @PostConstruct\n public void setUp(){\n serviceUri = env.getProperty(\"fr.insee.pogues.api.remote.stromae.vis.url\");\n }\n\n @Override\n public String transform(String input, Map params) throws Exception {\n try {\n String uri = String.format(\"%s\/%s\", serviceUri,\n params.get(\"name\"));\n HttpPost post = new HttpPost(uri);\n post.setEntity(new StringEntity(input, StandardCharsets.UTF_8));\n post.setHeader(\"Content-type\", \"application\/xml\");\n HttpResponse response = httpClient.execute(post);\n return EntityUtils.toString(response.getEntity());\n } catch(Exception e) {\n throw e;\n }\n\n }\n}\n","new_contents":"package fr.insee.pogues.transforms;\n\nimport org.apache.http.HttpResponse;\nimport org.apache.http.client.HttpClient;\nimport org.apache.http.client.methods.HttpPost;\nimport org.apache.http.entity.StringEntity;\nimport org.apache.http.util.EntityUtils;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.beans.factory.annotation.Value;\nimport org.springframework.stereotype.Service;\n\nimport java.nio.charset.StandardCharsets;\nimport java.util.Map;\n\n@Service\npublic class StromaeServiceImpl implements StromaeService {\n\n @Autowired\n HttpClient httpClient;\n\n @Value(\"${fr.insee.pogues.api.remote.stromae.vis.url}\")\n private String serviceUri;\n\n @Override\n public String transform(String input, Map params) throws Exception {\n try {\n String uri = String.format(\"%s\/%s\", serviceUri,\n params.get(\"name\"));\n HttpPost post = new HttpPost(uri);\n post.setEntity(new StringEntity(input, StandardCharsets.UTF_8));\n post.setHeader(\"Content-type\", \"application\/xml\");\n HttpResponse response = httpClient.execute(post);\n return EntityUtils.toString(response.getEntity());\n } catch(Exception e) {\n throw e;\n }\n\n }\n}\n","subject":"Use value declarations instead of env injection"} {"old_contents":"package hu.webarticum.treeprinter.printer;\n\nimport hu.webarticum.treeprinter.TreeNode;\nimport hu.webarticum.treeprinter.printer.listing.ListingTreePrinter;\n\n\/**\n * Main interface for tree printers. \n * \n * A tree printer visualize a {@link TreeNode} and its entire subtree structure.\n * Any implementation can have its own way to do this.\n * Some implementations (e. g. {@link ListingTreePrinter}) can print\n * large data in a memory efficient way via\n * print(TreeNode) or print(TreeNode, Appendable).\n *\/\n@FunctionalInterface\npublic interface TreePrinter {\n\n public void print(TreeNode rootNode, Appendable out);\n \n public default void print(TreeNode rootNode) {\n print(rootNode, System.out);\n }\n \n public default String stringify(TreeNode rootNode) {\n StringBuilder builder = new StringBuilder();\n print(rootNode, builder);\n return builder.toString();\n }\n \n}\n","new_contents":"package hu.webarticum.treeprinter.printer;\n\nimport hu.webarticum.treeprinter.TreeNode;\nimport hu.webarticum.treeprinter.printer.listing.ListingTreePrinter;\n\n\/**\n * Main interface for tree printers. \n * \n * A tree printer visualize a {@link TreeNode} and its entire subtree structure.\n * Any implementation can have its own way to do this.\n * Some implementations (e. g. {@link ListingTreePrinter}) can print\n * large data in a memory efficient way via\n * print(TreeNode)<\/code> or print(TreeNode, Appendable)<\/code>.\n *\/\n@FunctionalInterface\npublic interface TreePrinter {\n\n public void print(TreeNode rootNode, Appendable out);\n \n public default void print(TreeNode rootNode) {\n print(rootNode, System.out);\n }\n \n public default String stringify(TreeNode rootNode) {\n StringBuilder builder = new StringBuilder();\n print(rootNode, builder);\n return builder.toString();\n }\n \n}\n","subject":"Fix invalid html in a doc comment"} {"old_contents":"package info.u_team.u_team_test.item;\n\nimport info.u_team.u_team_core.item.UItem;\nimport info.u_team.u_team_test.init.TestItemGroups;\nimport net.minecraft.item.*;\nimport net.minecraft.potion.*;\nimport net.minecraftforge.api.distmarker.*;\n\npublic class BasicFoodItem extends UItem {\n\t\n\tprivate static final Food FOOD = (new Food.Builder()).hunger(4).saturation(1.2F).effect(() -> new EffectInstance(Effects.GLOWING, 200, 0), 1).setAlwaysEdible().fastToEat().build();\n\t\n\tpublic BasicFoodItem(String name) {\n\t\tsuper(name, TestItemGroups.GROUP, new Properties().rarity(Rarity.RARE).food(FOOD));\n\t}\n\t\n\t@OnlyIn(Dist.CLIENT)\n\t@Override\n\tpublic boolean hasEffect(ItemStack stack) {\n\t\treturn true;\n\t}\n}\n","new_contents":"package info.u_team.u_team_test.item;\n\nimport info.u_team.u_team_core.item.UItem;\nimport info.u_team.u_team_test.init.TestItemGroups;\nimport net.minecraft.item.*;\nimport net.minecraft.potion.*;\nimport net.minecraftforge.api.distmarker.*;\n\npublic class BasicFoodItem extends UItem {\n\t\n\tprivate static final Food FOOD = (new Food.Builder()).hunger(4).saturation(1.2F).effect(() -> new EffectInstance(Effects.GLOWING, 200, 0), 1).setAlwaysEdible().fastToEat().build();\n\t\n\tpublic BasicFoodItem() {\n\t\tsuper(TestItemGroups.GROUP, new Properties().rarity(Rarity.RARE).food(FOOD));\n\t}\n\t\n\t@OnlyIn(Dist.CLIENT)\n\t@Override\n\tpublic boolean hasEffect(ItemStack stack) {\n\t\treturn true;\n\t}\n}\n","subject":"Remove string name ctor from basic food item"} {"old_contents":"package uk.ac.ebi.atlas.tsne;\n\nimport com.google.common.collect.ImmutableMap;\n\nimport javax.inject.Inject;\nimport javax.inject.Named;\nimport java.util.concurrent.ThreadLocalRandom;\nimport java.util.stream.Collectors;\n\n@Named\npublic class GeneExpressionDao {\n\n private final TSnePlotDao tSnePlotDao;\n\n @Inject\n public GeneExpressionDao(TSnePlotDao tSnePlotDao) {\n this.tSnePlotDao = tSnePlotDao;\n }\n\n public ImmutableMap fetchGeneExpression(String experimentAccession, String geneId) {\n return ImmutableMap.copyOf(\n tSnePlotDao.fetchTSnePlotPoints(experimentAccession)\n .values().stream()\n .collect(\n Collectors.toMap(\n TSnePoint::name, p -> ThreadLocalRandom.current().nextDouble(0.0, 10000.0))));\n }\n}\n","new_contents":"package uk.ac.ebi.atlas.tsne;\n\nimport com.google.common.collect.ImmutableMap;\n\nimport javax.inject.Inject;\nimport javax.inject.Named;\nimport java.util.concurrent.ThreadLocalRandom;\nimport java.util.stream.Collectors;\n\nimport static org.apache.commons.lang3.StringUtils.isBlank;\n\n@Named\npublic class GeneExpressionDao {\n\n private final TSnePlotDao tSnePlotDao;\n\n @Inject\n public GeneExpressionDao(TSnePlotDao tSnePlotDao) {\n this.tSnePlotDao = tSnePlotDao;\n }\n\n public ImmutableMap fetchGeneExpression(String experimentAccession, String geneId) {\n return ImmutableMap.copyOf(\n tSnePlotDao.fetchTSnePlotPoints(experimentAccession)\n .values().stream()\n .collect(\n Collectors.toMap(\n TSnePoint::name,\n p -> isBlank(geneId) ?\n 0.0 : ThreadLocalRandom.current().nextDouble(0.0, 10000.0))));\n }\n}\n","subject":"Return 0 expression level if gene ID is blank"} {"old_contents":"package com.bugsnag.android;\n\nimport org.json.JSONObject;\n\nimport com.bugsnag.android.DeviceData;\n\npublic class DeviceDataTest extends BugsnagTestCase {\n public void testSaneValues() {\n DeviceData deviceData = new DeviceData(getContext());\n\n assertTrue(deviceData.getScreenDensity() > 0);\n assertNotNull(deviceData.getScreenResolution());\n assertNotNull(deviceData.getTotalMemory());\n assertNotNull(deviceData.isRooted());\n assertNotNull(deviceData.getLocale());\n assertNotNull(deviceData.getAndroidId());\n }\n}\n","new_contents":"package com.bugsnag.android;\n\nimport org.json.JSONObject;\n\nimport com.bugsnag.android.DeviceData;\n\npublic class DeviceDataTest extends BugsnagTestCase {\n public void testSaneValues() {\n DeviceData deviceData = new DeviceData(getContext());\n\n assertTrue(deviceData.getScreenDensity() > 0);\n assertNotNull(deviceData.getScreenResolution());\n assertNotNull(deviceData.getTotalMemory());\n assertNotNull(deviceData.isRooted());\n assertNotNull(deviceData.getLocale());\n\n if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.FROYO) {\n \/\/ Emulators returned null for android id before android 2.2\n assertNotNull(deviceData.getAndroidId());\n }\n }\n}\n","subject":"Handle emulator bug in tests"} {"old_contents":"package com.biotronisis.pettplant.debug;\n\npublic class MyDebug {\n public static final boolean LOG = true;\n}","new_contents":"package com.biotronisis.pettplant.debug;\n\npublic class MyDebug {\n public static final boolean LOG = false;\n}\n","subject":"Change value of debug flag."} {"old_contents":"package com.toomasr.sgf4j.filetree;\n\nimport java.io.File;\n\nimport javafx.scene.control.TreeCell;\n\npublic class FileFormatCell extends TreeCell {\n public FileFormatCell() {\n super();\n }\n\n protected void updateItem(File item, boolean empty) {\n super.updateItem(item, empty);\n if (empty || item == null) {\n setText(null);\n setGraphic(null);\n }\n else {\n \/*\n * For a root device on a Mac getName will return an empty string\n * but actually I'd like to show a slash designating the root device\n *\n *\/\n if (\"\".equals(item.getName()))\n setText(item.getAbsolutePath());\n else\n setText(item.getName());\n }\n }\n}\n","new_contents":"package com.toomasr.sgf4j.filetree;\n\nimport java.io.File;\n\nimport com.toomasr.sgf4j.metasystem.MetaSystem;\nimport com.toomasr.sgf4j.metasystem.ProblemStatus;\n\nimport javafx.scene.control.TreeCell;\nimport javafx.scene.image.Image;\nimport javafx.scene.image.ImageView;\n\npublic class FileFormatCell extends TreeCell {\n private Image noneImage = new Image(getClass().getResourceAsStream(\"\/icons\/none_16x16.png\"));\n private Image failedImage = new Image(getClass().getResourceAsStream(\"\/icons\/failed_16x16.png\"));\n private Image solvedImage = new Image(getClass().getResourceAsStream(\"\/icons\/solved_16x16.png\"));\n\n public FileFormatCell() {\n super();\n }\n\n protected void updateItem(File file, boolean empty) {\n super.updateItem(file, empty);\n if (empty || file == null) {\n setText(null);\n setGraphic(null);\n }\n else {\n \/*\n * For a root device on a Mac getName will return an empty string\n * but actually I'd like to show a slash designating the root device\n *\n *\/\n if (\"\".equals(file.getName()))\n setText(file.getAbsolutePath());\n \/*\n * For SGF files we want to show some custom icons.\n *\/\n else if (file != null && file.isFile() && file.toString().toLowerCase().endsWith(\"sgf\")) {\n setText(file.getName());\n if (MetaSystem.systemExists(file.toPath())) {\n ProblemStatus status = MetaSystem.getStatus(file.toPath());\n\n if (status == ProblemStatus.NONE)\n setGraphic(new ImageView(noneImage));\n else if (status == ProblemStatus.FAIL)\n setGraphic(new ImageView(failedImage));\n else\n setGraphic(new ImageView(solvedImage));\n }\n else {\n setGraphic(null);\n }\n }\n else {\n setText(file.getName());\n setGraphic(null);\n }\n }\n }\n}\n","subject":"Use new icons in the tree"} {"old_contents":"\/*\n * Copyright 2016 Hammock and its contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n * implied.\n *\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage ws.ament.hammock;\n\npublic class Bootstrap {\n public static void main(String[] args) {\n org.jboss.weld.environment.se.StartMain.main(args);\n }\n}\n","new_contents":"\/*\n * Copyright 2016 Hammock and its contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n * implied.\n *\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage ws.ament.hammock;\n\npublic class Bootstrap {\n public static void main(String... args) {\n org.jboss.weld.environment.se.StartMain.main(args);\n }\n}\n","subject":"Use var args for main."} {"old_contents":"package br.com.MDSGPP.ChamadaParlamentar.model;\n\nimport java.util.ArrayList;\n\npublic class Estatistica {\n\n\tprivate String nome;\n\tprivate String numeroSessao;\n\tprivate String totalSessao;\n\tprivate String porcentagem;\n\tprivate ArrayList lista = new ArrayList(); \n\t\n\tpublic Estatistica(){\t\t\n\t}\n\n\tpublic String getNumeroSessao() {\n\t\treturn numeroSessao;\n\t}\n\n\tpublic void setNumeroSessao(String numeroSessao) {\n\t\tthis.numeroSessao = numeroSessao;\n\t}\n\n\tpublic String getTotalSessao() {\n\t\treturn totalSessao;\n\t}\n\n\tpublic void setTotalSessao(String totalSessao) {\n\t\tthis.totalSessao = totalSessao;\n\t}\n\n\tpublic String getNome() {\n\t\treturn nome;\n\t}\n\n\tpublic void setNome(String nome) {\n\t\tthis.nome = nome;\n\t}\n\n\tpublic String getPorcentagem() {\n\t\treturn porcentagem;\n\t}\n\n\tpublic void setPorcentagem(String porcentagem) {\n\t\tthis.porcentagem = porcentagem;\n\t}\n\n\tpublic ArrayList getLista() {\n\t\treturn lista;\n\t}\n\n\tpublic void setLista(ArrayList lista) {\n\t\tthis.lista = lista;\n\t}\n}\n\n\n","new_contents":"package br.com.MDSGPP.ChamadaParlamentar.model;\n\nimport java.util.ArrayList;\n\npublic class Estatistica {\n\n\tprivate String name;\n\tprivate String numberOfSession;\n\tprivate String totalSessao;\n\tprivate String percentage;\n\tprivate ArrayList lista = new ArrayList(); \n\t\n\tpublic Estatistica(){\t\t\n\t}\n\n\tpublic String getNumeroSessao() {\n\t\treturn numberOfSession;\n\t}\n\n\tpublic void setNumeroSessao(String numberOfSession) {\n\t\tthis.numberOfSession = numberOfSession;\n\t}\n\n\tpublic String getTotalSessao() {\n\t\treturn totalSessao;\n\t}\n\n\tpublic void setTotalSessao(String totalSessao) {\n\t\tthis.totalSessao = totalSessao;\n\t}\n\n\tpublic String getNome() {\n\t\treturn name;\n\t}\n\n\tpublic void setNome(String name) {\n\t\tthis.name = name;\n\t}\n\n\tpublic String getPorcentagem() {\n\t\treturn percentage;\n\t}\n\n\tpublic void setPorcentagem(String percentage) {\n\t\tthis.percentage = percentage;\n\t}\n\n\tpublic ArrayList getLista() {\n\t\treturn list;\n\t}\n\n\tpublic void setLista(ArrayList list) {\n\t\tthis.list = list;\n\t}\n}\n\n\n","subject":"Change of variables of Estatisitca"} {"old_contents":"package com.Acrobot.ChestShop.Logging;\n\nimport java.text.DateFormat;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.logging.Formatter;\nimport java.util.logging.LogRecord;\n\n\/**\n * @author Acrobot\n *\/\npublic class FileFormatter extends Formatter {\n private final DateFormat dateFormat = new SimpleDateFormat(\"yyyy\/MM\/dd HH:mm:ss\");\n\n @Override\n public String format(LogRecord record) {\n return getDateAndTime() + ' ' + record.getMessage() + '\\n';\n }\n\n private String getDateAndTime() {\n Date date = new Date();\n\n return dateFormat.format(date);\n }\n}\n","new_contents":"package com.Acrobot.ChestShop.Logging;\n\nimport java.io.PrintWriter;\nimport java.io.StringWriter;\nimport java.text.DateFormat;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.logging.Formatter;\nimport java.util.logging.Level;\nimport java.util.logging.LogRecord;\n\n\/**\n * @author Acrobot\n *\/\npublic class FileFormatter extends Formatter {\n private final DateFormat dateFormat = new SimpleDateFormat(\"yyyy\/MM\/dd HH:mm:ss\");\n\n @Override\n public String format(LogRecord record) {\n StringBuilder message = new StringBuilder(getDateAndTime());\n\n if (record.getLevel() != Level.INFO) {\n message.append(' ').append(record.getLevel().getLocalizedName());\n }\n\n message.append(' ').append(record.getMessage());\n\n if (record.getThrown() != null) {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n pw.println();\n record.getThrown().printStackTrace(pw);\n pw.close();\n message.append(sw.toString());\n }\n\n return message.append('\\n').toString();\n }\n\n private String getDateAndTime() {\n Date date = new Date();\n\n return dateFormat.format(date);\n }\n}\n","subject":"Include log level (if not INFO) and error stack trace in log file"} {"old_contents":"package me.zford.jobs.bukkit.actions;\r\n\r\nimport me.zford.jobs.container.ActionInfo;\r\nimport me.zford.jobs.container.ActionType;\r\nimport me.zford.jobs.container.BaseActionInfo;\r\n\r\nimport org.bukkit.inventory.ItemStack;\r\n\r\npublic class ItemActionInfo extends BaseActionInfo implements ActionInfo {\r\n private ItemStack items;\r\n public ItemActionInfo(ItemStack items, ActionType type) {\r\n super(type);\r\n this.items = items;\r\n }\r\n \r\n @Override\r\n public String getName() {\r\n return items.getType().toString();\r\n }\r\n\r\n @Override\r\n public String getNameWithSub() {\r\n return getName()+\":\"+items.getData();\r\n }\r\n}\r\n","new_contents":"package me.zford.jobs.bukkit.actions;\r\n\r\nimport me.zford.jobs.container.ActionInfo;\r\nimport me.zford.jobs.container.ActionType;\r\nimport me.zford.jobs.container.BaseActionInfo;\r\n\r\nimport org.bukkit.inventory.ItemStack;\r\n\r\npublic class ItemActionInfo extends BaseActionInfo implements ActionInfo {\r\n private ItemStack items;\r\n public ItemActionInfo(ItemStack items, ActionType type) {\r\n super(type);\r\n this.items = items;\r\n }\r\n \r\n @Override\r\n public String getName() {\r\n return items.getType().toString();\r\n }\r\n\r\n @Override\r\n public String getNameWithSub() {\r\n return getName()+\":\"+items.getData().getData();\r\n }\r\n}\r\n","subject":"Fix smelting and crafting with subtypes"} {"old_contents":"\/*\n * Copyright (C) 2015 higherfrequencytrading.com\n *\n * This program is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program. If not, see .\n *\/\n\npackage net.openhft.chronicle.bytes;\n\n\/**\n * @author peter.lawrey\n *\/\npublic enum StopCharTesters implements StopCharTester {\n COMMA_STOP {\n @Override\n public boolean isStopChar(int ch) {\n return ch < ' ' || ch == ',';\n }\n }, CONTROL_STOP {\n @Override\n public boolean isStopChar(int ch) {\n return ch < ' ';\n }\n },\n SPACE_STOP {\n @Override\n public boolean isStopChar(int ch) {\n return Character.isWhitespace(ch) || ch == 0;\n }\n },\n QUOTES {\n @Override\n public boolean isStopChar(int ch) throws IllegalStateException {\n return ch == '\"' || ch <= 0;\n }\n };\n}\n","new_contents":"\/*\n * Copyright (C) 2015 higherfrequencytrading.com\n *\n * This program is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program. If not, see .\n *\/\n\npackage net.openhft.chronicle.bytes;\n\n\/**\n * @author peter.lawrey\n *\/\npublic enum StopCharTesters implements StopCharTester {\n COMMA_STOP {\n @Override\n public boolean isStopChar(int ch) {\n return ch < ' ' || ch == ',';\n }\n }, CONTROL_STOP {\n @Override\n public boolean isStopChar(int ch) {\n return ch < ' ';\n }\n },\n SPACE_STOP {\n @Override\n public boolean isStopChar(int ch) {\n return Character.isWhitespace(ch) || ch == 0;\n }\n },\n QUOTES {\n @Override\n public boolean isStopChar(int ch) throws IllegalStateException {\n return ch == '\"' || ch <= 0;\n }\n },\n ALL {\n @Override\n public boolean isStopChar(int ch) {\n return ch < 0;\n }\n };\n}\n","subject":"Update to use chronicle bytes - there are a number of tests that are failing and are marked with ignore."} {"old_contents":"package uk.ac.edukapp.util;\r\n\r\nimport javax.servlet.http.Cookie;\r\nimport javax.servlet.http.HttpServletRequest;\r\n\r\npublic class ServletUtils {\r\n\r\n\tpublic static String getCookieValue(Cookie[] cookies, String cookieName,\r\n\t\t\tString defaultValue) {\r\n\t\tfor (int i = 0; i < cookies.length; i++) {\r\n\t\t\tCookie cookie = cookies[i];\r\n\t\t\tif (cookieName.equals(cookie.getName()))\r\n\t\t\t\treturn (cookie.getValue());\r\n\t\t}\r\n\t\treturn (defaultValue);\r\n\t}\r\n\r\n\tpublic static String getServletRootURL ( HttpServletRequest request ) {\r\n\t\tString serverName = request.getServerName();\r\n\t\tint serverPort = request.getServerPort();\r\n\t\tString protocol;\r\n\t\t\r\n\t\tif (request.isSecure()){\r\n\t\t\tprotocol = \"https\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tprotocol = \"http\";\r\n\t\t}\r\n\t\t\r\n\t\tString root = protocol+\":\/\/\"+serverName+\":\"+serverPort+\"\/edukapp\";\r\n\t\t\r\n\t\treturn root;\r\n\t}\r\n\t\r\n\t\r\n\tpublic static boolean isNumeric(String str) {\r\n\t\treturn str.matches(\"-?\\\\d+(.\\\\d+)?\");\r\n\t}\r\n}\r\n","new_contents":"package uk.ac.edukapp.util;\r\n\r\nimport javax.servlet.http.Cookie;\r\nimport javax.servlet.http.HttpServletRequest;\r\n\r\nimport org.apache.commons.validator.routines.UrlValidator;\r\n\r\npublic class ServletUtils {\r\n\r\n\tpublic static String getCookieValue(Cookie[] cookies, String cookieName,\r\n\t\t\tString defaultValue) {\r\n\t\tfor (int i = 0; i < cookies.length; i++) {\r\n\t\t\tCookie cookie = cookies[i];\r\n\t\t\tif (cookieName.equals(cookie.getName()))\r\n\t\t\t\treturn (cookie.getValue());\r\n\t\t}\r\n\t\treturn (defaultValue);\r\n\t}\r\n\r\n\tpublic static String getServletRootURL ( HttpServletRequest request ) {\r\n\t\tString serverName = request.getServerName();\r\n\t\tint serverPort = request.getServerPort();\r\n\t\tString protocol;\r\n\t\t\r\n\t\tif (request.isSecure()){\r\n\t\t\tprotocol = \"https\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tprotocol = \"http\";\r\n\t\t}\r\n\t\t\r\n\t\tString root = protocol+\":\/\/\"+serverName+\":\"+serverPort+\"\/edukapp\";\r\n\t\t\r\n\t\treturn root;\r\n\t}\r\n\t\r\n\t\r\n\tpublic static boolean isNumeric(String str) {\r\n\t\treturn str.matches(\"-?\\\\d+(.\\\\d+)?\");\r\n\t}\r\n\t\r\n\tpublic static boolean checkURL ( String url ) {\r\n\t\tString schemes[] = {\"http\", \"https\"};\r\n\t\tUrlValidator urlValidator = new UrlValidator(schemes);\r\n\t\treturn urlValidator.isValid(url);\r\n\t}\r\n}\r\n","subject":"Support for web url widget creator"} {"old_contents":"package de.gurkenlabs.litiengine;\r\n\r\nimport de.gurkenlabs.litiengine.util.TimeUtilities;\r\n\r\npublic class RenderLoop extends UpdateLoop {\r\n\r\n private int maxFps;\r\n\r\n public RenderLoop(String name) {\r\n super(name);\r\n this.maxFps = Game.getConfiguration().client().getMaxFps();\r\n }\r\n\r\n @Override\r\n public void run() {\r\n while (!interrupted()) {\r\n final long fpsWait = (long) (1.0 \/ this.maxFps * 1000);\r\n final long renderStart = System.nanoTime();\r\n try {\r\n Game.getCamera().updateFocus();\r\n this.update();\r\n\r\n Game.getScreenManager().getRenderComponent().render();\r\n\r\n final long renderTime = (long) TimeUtilities.nanoToMs(System.nanoTime() - renderStart);\r\n\r\n long wait = Math.max(0, fpsWait - renderTime);\r\n if (wait != 0) {\r\n Thread.sleep(wait);\r\n }\r\n } catch (final InterruptedException e) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n @Override\r\n public void terminate() {\r\n interrupt();\r\n }\r\n\r\n public int getMaxFps() {\r\n return maxFps;\r\n }\r\n\r\n public void setMaxFps(int maxFps) {\r\n this.maxFps = maxFps;\r\n }\r\n}\r\n","new_contents":"package de.gurkenlabs.litiengine;\r\n\r\nimport de.gurkenlabs.litiengine.util.TimeUtilities;\r\n\r\npublic class RenderLoop extends UpdateLoop {\r\n\r\n private int maxFps;\r\n\r\n public RenderLoop(String name) {\r\n super(name);\r\n this.maxFps = Game.getConfiguration().client().getMaxFps();\r\n }\r\n\r\n @Override\r\n public void run() {\r\n while (!interrupted()) {\r\n final long fpsWait = (long) (1000.0 \/ this.maxFps);\r\n final long renderStart = System.nanoTime();\r\n try {\r\n Game.getCamera().updateFocus();\r\n this.update();\r\n\r\n Game.getScreenManager().getRenderComponent().render();\r\n\r\n final long renderTime = (long) TimeUtilities.nanoToMs(System.nanoTime() - renderStart);\r\n\r\n long wait = Math.max(0, fpsWait - renderTime);\r\n if (wait != 0) {\r\n Thread.sleep(wait);\r\n }\r\n } catch (final InterruptedException e) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n @Override\r\n public void terminate() {\r\n interrupt();\r\n }\r\n\r\n public int getMaxFps() {\r\n return maxFps;\r\n }\r\n\r\n public void setMaxFps(int maxFps) {\r\n this.maxFps = maxFps;\r\n }\r\n}\r\n","subject":"Improve the math here, and make it less confusing"} {"old_contents":"\npackage edu.wpi.first.wpilibj.technobots;\n\nimport edu.wpi.first.wpilibj.Joystick;\nimport edu.wpi.first.wpilibj.buttons.Button;\nimport edu.wpi.first.wpilibj.buttons.DigitalIOButton;\nimport edu.wpi.first.wpilibj.buttons.JoystickButton;\nimport edu.wpi.first.wpilibj.technobots.commands.SweeperOn;\n\n\/**\n * This class is the glue that binds the controls on the physical operator\n * interface to the commands and command groups that allow control of the robot.\n *\/\npublic class OI {\n\n Joystick xbox = new Joystick(1);\n Button button1 = new JoystickButton(xbox,1);\n\n public OI() {\n\n button1.whenPressed(new SweeperOn());\n }\n}\n\n","new_contents":"\npackage edu.wpi.first.wpilibj.technobots;\n\nimport edu.wpi.first.wpilibj.Joystick;\nimport edu.wpi.first.wpilibj.buttons.Button;\nimport edu.wpi.first.wpilibj.buttons.DigitalIOButton;\nimport edu.wpi.first.wpilibj.buttons.JoystickButton;\nimport edu.wpi.first.wpilibj.technobots.commands.SweeperOn;\n\n\/**\n * This class is the glue that binds the controls on the physical operator\n * interface to the commands and command groups that allow control of the robot.\n *\/\npublic class OI {\n\n Joystick xbox;\n Button button1;\n\n public OI() {\n\n xbox = new Joystick(1);\n button1 = new JoystickButton(xbox,1);\n\n button1.whenPressed(new SweeperOn());\n }\n}\n\n","subject":"Change where values are initiated"} {"old_contents":"package entitygen;\n\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.ByteBuffer;\n\npublic class FileClassLoader extends ClassLoader {\n\n\tpublic FileClassLoader() {\n\t\t\/\/ Empty\n\t}\n\n\tpublic Class nameToClass(String className, String fileName) {\n\t\ttry (InputStream is = new FileInputStream(fileName);) {\n\t\t\tint n = is.available();\n\t\t\tbyte[] bytes = new byte[n];\n\t\t\tint ret = is.read(bytes, 0, n);\n\t\t\tif (ret != n) {\n\t\t\t\tthrow new IOException(\"Expected \" + n + \" bytes but read \" + ret);\n\t\t\t}\n\t\t\tByteBuffer data = ByteBuffer.wrap(bytes);\n\t\t\treturn \tdefineClass(className, data, null);\n\t\t} catch (IOException e) {\n\t\t\tthrow new RuntimeException(\"Couldnt open \" + className + \"(\" + e + \")\", e);\n\t\t}\n\t\t\n\t}\n}\n","new_contents":"package entitygen;\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.ByteBuffer;\n\n\/**\n * Plain File-based class loader\n * @author Ian Darwin\n *\/\npublic class FileClassLoader extends ClassLoader {\n\n\tprivate final String dir;\n\n\tpublic FileClassLoader(String dir) {\n\t\tthis.dir = dir;\n\t}\n\t\n\t@Override\n\tpublic Class loadClass(String className) throws ClassNotFoundException {\n\t\tString fileName = dir + \"\/\" + className.replaceAll(\"\\\\.\", \"\/\") + \".class\";\n\t\tif (new File(fileName).exists()) {\n\t\t\treturn nameToClass(className, fileName);\n\t\t} else {\n\t\t\treturn getSystemClassLoader().loadClass(className);\n\t\t}\n\t}\n\n\tpublic Class nameToClass(String className, String fileName) {\n\t\ttry (InputStream is = new FileInputStream(fileName)) {\n\t\t\tint n = is.available();\n\t\t\tbyte[] bytes = new byte[n];\n\t\t\tint ret = is.read(bytes, 0, n);\n\t\t\tif (ret != n) {\n\t\t\t\tthrow new IOException(\"Expected \" + n + \" bytes but read \" + ret);\n\t\t\t}\n\t\t\tByteBuffer data = ByteBuffer.wrap(bytes);\n\t\t\treturn \tdefineClass(className, data, null);\n\t\t} catch (IOException e) {\n\t\t\tthrow new RuntimeException(\"Couldnt open \" + className + \"(\" + e + \")\", e);\n\t\t}\n\t\t\n\t}\n}\n","subject":"Make it grow up to be a real ClassLoader"} {"old_contents":"package core;\n\nimport java.io.*;\n\npublic class FileMnemonicMapLoader implements MnemonicMapLoader {\n\n private static final String DELIMETER = \"\\\\|\";\n private final BufferedReader reader;\n\n public FileMnemonicMapLoader(File dataFile) throws FileNotFoundException {\n this(new BufferedReader(new FileReader(dataFile)));\n }\n\n public FileMnemonicMapLoader(BufferedReader reader) {\n this.reader = reader;\n }\n\n @Override\n public void load(MnemonicMap map) throws IOException {\n String line = null;\n while ((line = reader.readLine()) != null) {\n String[] split = line.trim().split(DELIMETER);\n System.out.println(split.length);\n if (split.length == 3) {\n map.add(new MatchingMnemonic(split[2], new MatchingMnemonicDetail(split[1], split[0])));\n }\n }\n }\n}\n","new_contents":"package core;\n\nimport java.io.*;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class FileMnemonicMapLoader implements MnemonicMapLoader {\n\n private static final String DELIMETER = \"\\\\|\";\n private final BufferedReader[] readers;\n\n public FileMnemonicMapLoader(File... dataFile) throws FileNotFoundException {\n this(getBufferedReaders(dataFile));\n }\n\n private static BufferedReader[] getBufferedReaders(File[] dataFiles) throws FileNotFoundException {\n List readers = new ArrayList();\n for (File dataFile : dataFiles) {\n readers.add(new BufferedReader(new FileReader(dataFile)));\n }\n return readers.toArray(new BufferedReader[readers.size()]);\n }\n\n public FileMnemonicMapLoader(BufferedReader... readers) {\n this.readers = readers;\n }\n\n @Override\n public void load(MnemonicMap map) throws IOException {\n for (BufferedReader reader : readers) {\n String line = null;\n while ((line = reader.readLine()) != null) {\n String[] split = line.trim().split(DELIMETER);\n if (split.length == 3) {\n map.add(new MatchingMnemonic(split[2], new MatchingMnemonicDetail(split[1], split[0])));\n }\n }\n\/\/ reader.close();\n }\n }\n}\n","subject":"Update the File loader to support multiple input files (currently we have slogans but we couuld now have songs etc loaded (each one in a separate file)"} {"old_contents":"package de.gurkenlabs.litiengine.graphics;\r\n\r\nimport java.awt.geom.Point2D;\r\n\r\nimport de.gurkenlabs.litiengine.Game;\r\nimport de.gurkenlabs.litiengine.entities.IEntity;\r\nimport de.gurkenlabs.litiengine.graphics.animation.IAnimationController;\r\n\r\n\/**\r\n * The Class LocalPlayerCamera.\r\n *\/\r\npublic class PositionLockCamera extends Camera {\r\n private final IEntity entity;\r\n\r\n public PositionLockCamera(final IEntity entity) {\r\n super();\r\n this.entity = entity;\r\n this.updateFocus();\r\n }\r\n\r\n public IEntity getLockedEntity() {\r\n return this.entity;\r\n }\r\n\r\n @Override\r\n public Point2D getViewPortLocation(final IEntity entity) {\r\n if (entity == null) {\r\n return null;\r\n }\r\n\r\n \/\/ always render the local player at the same location otherwise the\r\n \/\/ localplayer camera causes flickering and bouncing of the sprite\r\n final IAnimationController animationController = Game.getEntityControllerManager().getAnimationController(entity);\r\n if (entity.equals(this.getLockedEntity()) && animationController != null && animationController.getCurrentAnimation() != null && animationController.getCurrentAnimation().getSpritesheet() != null) {\r\n final Spritesheet spriteSheet = animationController.getCurrentAnimation().getSpritesheet();\r\n final Point2D location = new Point2D.Double(this.getFocus().getX() - entity.getWidth() \/ 2 - (spriteSheet.getSpriteWidth() - entity.getWidth()) * 0.5, this.getFocus().getY() - entity.getHeight() \/ 2 - (spriteSheet.getSpriteHeight() - entity.getHeight()) * 0.5);\r\n return this.getViewPortLocation(location);\r\n }\r\n\r\n return super.getViewPortLocation(entity);\r\n }\r\n\r\n @Override\r\n public void updateFocus() {\r\n final Point2D cameraLocation = this.getLockedCameraLocation();\r\n\r\n this.setFocus(new Point2D.Double(cameraLocation.getX(), cameraLocation.getY()));\r\n super.updateFocus();\r\n }\r\n\r\n protected Point2D getLockedCameraLocation() {\r\n return this.getLockedEntity().getDimensionCenter();\r\n }\r\n}\r\n","new_contents":"package de.gurkenlabs.litiengine.graphics;\r\n\r\nimport java.awt.geom.Point2D;\r\n\r\nimport de.gurkenlabs.litiengine.entities.IEntity;\r\n\r\n\/**\r\n * The Class LocalPlayerCamera.\r\n *\/\r\npublic class PositionLockCamera extends Camera {\r\n private final IEntity entity;\r\n\r\n public PositionLockCamera(final IEntity entity) {\r\n super();\r\n this.entity = entity;\r\n this.updateFocus();\r\n }\r\n\r\n public IEntity getLockedEntity() {\r\n return this.entity;\r\n }\r\n\r\n @Override\r\n public void updateFocus() {\r\n final Point2D cameraLocation = this.getLockedCameraLocation();\r\n\r\n this.setFocus(new Point2D.Double(cameraLocation.getX(), cameraLocation.getY()));\r\n super.updateFocus();\r\n }\r\n\r\n protected Point2D getLockedCameraLocation() {\r\n return this.getLockedEntity().getDimensionCenter();\r\n }\r\n}\r\n","subject":"Remove the additional handling for the focused entity because this was only a result of the the gameloop having a lower updaterate than the renderloop which causes flickering because the position of entities is not updates as often as it is rendered."} {"old_contents":"\/*\n * Copyright 2003-2004 The Apache Software Foundation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n*\/\n\n\/*\n * Created on 02-Oct-2003\n *\n * This class defines the JMeter version only (moved from JMeterUtils)\n * \n * Version changes no longer change the JMeterUtils source file\n * - easier to spot when JMeterUtils really changes \n * - much smaller to download when the version changes\n * \n *\/\npackage org.apache.jmeter.util;\n\n\/**\n * Utility class to define the JMeter Version string\n * \n *\/\npublic class JMeterVersion\n{\n\n\t\/*\n\t * The VERSION string is updated by the Ant build file, which looks for the\n\t * pattern: VERSION = .*\n\t * \n\t *\/\n\tstatic final String VERSION = \"2.1.20041210\";\n\n\tstatic final String COPYRIGHT = \"Copyright (c) 1998-2004 The Apache Software Foundation\";\n\t\n private JMeterVersion() \/\/ Not instantiable\n {\n super();\n }\n\n}\n","new_contents":"\/*\n * Copyright 2003-2005 The Apache Software Foundation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n*\/\n\n\/*\n * Created on 02-Oct-2003\n *\n * This class defines the JMeter version only (moved from JMeterUtils)\n * \n * Version changes no longer change the JMeterUtils source file\n * - easier to spot when JMeterUtils really changes \n * - much smaller to download when the version changes\n * \n *\/\npackage org.apache.jmeter.util;\n\n\/**\n * Utility class to define the JMeter Version string\n * \n *\/\npublic class JMeterVersion\n{\n\n\t\/*\n\t * The VERSION string is updated by the Ant build file, which looks for the\n\t * pattern: VERSION = .*\n\t * \n\t *\/\n\tstatic final String VERSION = \"2.1.20041210\";\n\n\tstatic final String COPYRIGHT = \"Copyright (c) 1998-2005 The Apache Software Foundation\";\n\t\n private JMeterVersion() \/\/ Not instantiable\n {\n super();\n }\n\n}\n","subject":"Update Copyright year to 2005"} {"old_contents":"\/**\n * Copyright 2005 The Apache Software Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.apache.hadoop.mapred;\n\n\/*******************************\n * Some handy constants\n * \n * @author Mike Cafarella\n *******************************\/\ninterface MRConstants {\n \/\/\n \/\/ Timeouts, constants\n \/\/\n public static final long HEARTBEAT_INTERVAL = 3 * 1000;\n public static final long TASKTRACKER_EXPIRY_INTERVAL = 60 * 1000;\n\n \/\/\n \/\/ Result codes\n \/\/\n public static int SUCCESS = 0;\n public static int FILE_NOT_FOUND = -1;\n}\n","new_contents":"\/**\n * Copyright 2005 The Apache Software Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.apache.hadoop.mapred;\n\n\/*******************************\n * Some handy constants\n * \n * @author Mike Cafarella\n *******************************\/\ninterface MRConstants {\n \/\/\n \/\/ Timeouts, constants\n \/\/\n public static final long HEARTBEAT_INTERVAL = 10 * 1000;\n public static final long TASKTRACKER_EXPIRY_INTERVAL = 10 * 60 * 1000;\n\n \/\/\n \/\/ Result codes\n \/\/\n public static int SUCCESS = 0;\n public static int FILE_NOT_FOUND = -1;\n}\n","subject":"Increase some intervals to further reduce stress on the jobtracker."} {"old_contents":"package com.bugsnag.android;\n\nimport android.support.annotation.NonNull;\n\nimport java.io.IOException;\nimport java.util.Date;\nimport java.util.LinkedList;\nimport java.util.List;\n\nclass Breadcrumbs implements JsonStream.Streamable {\n private static class Breadcrumb {\n private static final int MAX_MESSAGE_LENGTH = 140;\n final String timestamp;\n final String message;\n\n Breadcrumb(@NonNull String message) {\n this.timestamp = DateUtils.toISO8601(new Date());\n this.message = message.substring(0, Math.min(message.length(), MAX_MESSAGE_LENGTH));\n }\n }\n\n private static final int DEFAULT_MAX_SIZE = 20;\n private final List store = new LinkedList();\n private int maxSize = DEFAULT_MAX_SIZE;\n\n public void toStream(@NonNull JsonStream writer) throws IOException {\n writer.beginArray();\n\n for (Breadcrumb breadcrumb : store) {\n writer.beginArray();\n writer.value(breadcrumb.timestamp);\n writer.value(breadcrumb.message);\n writer.endArray();\n }\n\n writer.endArray();\n }\n\n void add(@NonNull String message) {\n if (store.size() >= maxSize) {\n store.remove(0);\n }\n\n store.add(new Breadcrumb(message));\n }\n\n void clear() {\n store.clear();\n }\n\n void setSize(int size) {\n if (size > store.size()) {\n this.maxSize = size;\n } else {\n store.subList(0, store.size() - size).clear();\n }\n }\n}\n","new_contents":"package com.bugsnag.android;\n\nimport android.support.annotation.NonNull;\n\nimport java.io.IOException;\nimport java.util.Date;\nimport java.util.Queue;\nimport java.util.concurrent.ConcurrentLinkedQueue;\n\nclass Breadcrumbs implements JsonStream.Streamable {\n private static class Breadcrumb {\n private static final int MAX_MESSAGE_LENGTH = 140;\n final String timestamp;\n final String message;\n\n Breadcrumb(@NonNull String message) {\n this.timestamp = DateUtils.toISO8601(new Date());\n this.message = message.substring(0, Math.min(message.length(), MAX_MESSAGE_LENGTH));\n }\n }\n\n private static final int DEFAULT_MAX_SIZE = 20;\n private final Queue store = new ConcurrentLinkedQueue<>();\n private int maxSize = DEFAULT_MAX_SIZE;\n\n public void toStream(@NonNull JsonStream writer) throws IOException {\n writer.beginArray();\n\n for (Breadcrumb breadcrumb : store) {\n writer.beginArray();\n writer.value(breadcrumb.timestamp);\n writer.value(breadcrumb.message);\n writer.endArray();\n }\n\n writer.endArray();\n }\n\n void add(@NonNull String message) {\n if (store.size() >= maxSize) {\n \/\/ Remove oldest breadcrumb\n store.poll();\n }\n store.add(new Breadcrumb(message));\n }\n\n void clear() {\n store.clear();\n }\n\n void setSize(int size) {\n if (size > store.size()) {\n this.maxSize = size;\n } else {\n \/\/ Remove oldest breadcrumbs until reaching the required size\n while (store.size() > size) {\n store.poll();\n }\n }\n }\n}\n","subject":"Switch breadcrumb store to ConcurrentLinkedQueue to prevent concurrency issues"} {"old_contents":"package org.xcolab.view.theme;\n\n\nimport org.springframework.stereotype.Component;\nimport org.springframework.util.Assert;\nimport org.springframework.web.servlet.ModelAndView;\nimport org.springframework.web.servlet.handler.HandlerInterceptorAdapter;\nimport org.springframework.web.servlet.view.RedirectView;\n\nimport org.xcolab.view.auth.AuthenticationService;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n@Component\npublic class ThemeVariableInterceptor extends HandlerInterceptorAdapter {\n\n private final AuthenticationService authenticationService;\n\n public ThemeVariableInterceptor(AuthenticationService authenticationService) {\n Assert.notNull(authenticationService, \"AuthenticationContext is required\");\n this.authenticationService = authenticationService;\n }\n\n @Override\n public void postHandle(HttpServletRequest request, HttpServletResponse response,\n Object handler, ModelAndView modelAndView) {\n if (modelAndView != null && !isRedirectView(modelAndView)) {\n ThemeContext themeContext = new ThemeContext();\n themeContext.init(authenticationService, request);\n modelAndView.addObject(themeContext);\n }\n }\n\n private boolean isRedirectView(ModelAndView modelAndView) {\n return (modelAndView.getView() != null && modelAndView.getView() instanceof RedirectView)\n || modelAndView.getViewName().startsWith(\"redirect:\");\n }\n\n}\n","new_contents":"package org.xcolab.view.theme;\n\n\nimport org.springframework.stereotype.Component;\nimport org.springframework.util.Assert;\nimport org.springframework.web.servlet.ModelAndView;\nimport org.springframework.web.servlet.handler.HandlerInterceptorAdapter;\nimport org.springframework.web.servlet.view.RedirectView;\n\nimport org.xcolab.view.auth.AuthenticationService;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n@Component\npublic class ThemeVariableInterceptor extends HandlerInterceptorAdapter {\n\n private final AuthenticationService authenticationService;\n\n public ThemeVariableInterceptor(AuthenticationService authenticationService) {\n Assert.notNull(authenticationService, \"AuthenticationContext is required\");\n this.authenticationService = authenticationService;\n }\n\n @Override\n public void postHandle(HttpServletRequest request, HttpServletResponse response,\n Object handler, ModelAndView modelAndView) {\n if (modelAndView != null && !isRedirectView(modelAndView)) {\n ThemeContext themeContext = new ThemeContext();\n themeContext.init(authenticationService, request);\n modelAndView.addObject(\"_themeContext\", themeContext);\n }\n }\n\n private boolean isRedirectView(ModelAndView modelAndView) {\n return (modelAndView.getView() != null && modelAndView.getView() instanceof RedirectView)\n || modelAndView.getViewName().startsWith(\"redirect:\");\n }\n\n}\n","subject":"Add attribute name to themeContext object"} {"old_contents":"package com.wwsean08.WeatherReport.pojo;\n\nimport com.google.gson.annotations.SerializedName;\n\n\/**\n * Created by wwsea_000 on 12\/30\/2015.\n *\/\npublic class RabbitMQJson\n{\n @SerializedName(\"location\")\n private String location;\n @SerializedName(\"temperature\")\n private float temp;\n @SerializedName(\"icon\")\n private String icon;\n\n public String getLocation()\n {\n return location;\n }\n\n public void setLocation(String location)\n {\n this.location = location;\n }\n\n public float getTemp()\n {\n return temp;\n }\n\n public void setTemp(float temp)\n {\n this.temp = temp;\n }\n\n public String getIcon()\n {\n return icon;\n }\n\n public void setIcon(String icon)\n {\n this.icon = icon;\n }\n}\n","new_contents":"package com.wwsean08.WeatherReport.pojo;\n\nimport com.google.gson.annotations.SerializedName;\nimport com.sun.glass.ui.SystemClipboard;\n\n\/**\n * Created by wwsea_000 on 12\/30\/2015.\n *\/\npublic class RabbitMQJson\n{\n @SerializedName(\"location\")\n private String location;\n @SerializedName(\"temperature\")\n private float temp;\n @SerializedName(\"icon\")\n private String icon;\n @SerializedName(\"timestamp\")\n private long timestamp = System.currentTimeMillis();\n\n public String getLocation()\n {\n return location;\n }\n\n public void setLocation(String location)\n {\n this.location = location;\n }\n\n public float getTemp()\n {\n return temp;\n }\n\n public void setTemp(float temp)\n {\n this.temp = temp;\n }\n\n public String getIcon()\n {\n return icon;\n }\n\n public void setIcon(String icon)\n {\n this.icon = icon;\n }\n}\n","subject":"Include a timestamp of when the data was requested from wunderground (roughly)"} {"old_contents":"package com.grayben.riskExtractor.htmlScorer;\n\nimport java.util.ListIterator;\n\npublic interface ScoredText {\n\tListIterator getListIterator();\n\tListIterator getListIterator(int index);\n\t\n}\n","new_contents":"package com.grayben.riskExtractor.htmlScorer;\n\nimport java.util.List;\n\npublic interface ScoredText {\n\tList getList();\n\t\n}\n","subject":"Remove Iterator retrival from interface"} {"old_contents":"package org.linuxguy.MarketBot.samples;\n\nimport org.linuxguy.MarketBot.Comment;\nimport org.linuxguy.MarketBot.GooglePlayWatcher;\nimport org.linuxguy.MarketBot.Notifier;\n\n\/**\n * Sample client implementation\n * \n * This class monitors an app in the Google Play Store and prints new\n * reviews to the console.\n *\/\npublic class GooglePlayLogger {\n public static void main(String[] args) throws InterruptedException {\n if (args.length < 4) {\n printUsage();\n System.exit(-1);\n }\n\n String username = args[0];\n String password = args[1];\n String app_id = args[2];\n\n GooglePlayWatcher playWatcher = new GooglePlayWatcher(username, password, app_id);\n\n playWatcher.addListener(new ConsoleNotifier());\n\n playWatcher.start();\n playWatcher.join();\n }\n\n private static class ConsoleNotifier extends Notifier {\n\n @Override\n public void onNewResult(Comment result) {\n System.out.println(\"Response : \" + result);\n }\n }\n\n private static void printUsage() {\n System.out.println(String.format(\"Usage: %s \", GooglePlayLogger.class.getName()));\n }\n}","new_contents":"package org.linuxguy.MarketBot.samples;\n\nimport org.linuxguy.MarketBot.Comment;\nimport org.linuxguy.MarketBot.GooglePlayWatcher;\nimport org.linuxguy.MarketBot.Notifier;\n\n\/**\n * Sample client implementation\n * \n * This class monitors an app in the Google Play Store and prints new\n * reviews to the console.\n *\/\npublic class GooglePlayLogger {\n public static void main(String[] args) throws InterruptedException {\n if (args.length < 3) {\n printUsage();\n System.exit(-1);\n }\n\n String username = args[0];\n String password = args[1];\n String app_id = args[2];\n\n GooglePlayWatcher playWatcher = new GooglePlayWatcher(username, password, app_id);\n\n playWatcher.addListener(new ConsoleNotifier());\n\n playWatcher.start();\n playWatcher.join();\n }\n\n private static class ConsoleNotifier extends Notifier {\n\n @Override\n public void onNewResult(Comment result) {\n System.out.println(\"Response : \" + result);\n }\n }\n\n private static void printUsage() {\n System.out.println(String.format(\"Usage: \", GooglePlayLogger.class.getName()));\n }\n}","subject":"Fix the number of required arguments. Update the usage message."} {"old_contents":"package com.twotoasters.servos.util;\n\nimport android.os.Build;\n\npublic final class DeviceUtils {\n\n private DeviceUtils() { }\n\n public static boolean isEmulator() {\n switch (Build.PRODUCT) {\n case \"sdk_phone_x86\": \/\/ fall through\n case \"google_sdk\": \/\/ fall through\n case \"sdk\": \/\/ fall through\n case \"sdk_x86\": \/\/ fall through\n case \"vbox86p\": return true;\n default: return false;\n }\n }\n}\n","new_contents":"package com.twotoasters.servos.util;\n\nimport android.os.Build;\n\npublic final class DeviceUtils {\n\n private DeviceUtils() { }\n\n public static boolean isEmulator() {\n switch (Build.PRODUCT) {\n case \"google_sdk\": \/\/ fall through\n case \"sdk\": \/\/ fall through\n case \"sdk_google_phone_x86\": \/\/ fall through\n case \"sdk_phone_x86\": \/\/ fall through\n case \"sdk_x86\": \/\/ fall through\n case \"vbox86p\": return true;\n default: return false;\n }\n }\n}\n","subject":"Update logic to check for emulator"} {"old_contents":"package info.u_team.u_team_core.container;\n\nimport info.u_team.u_team_core.api.fluid.IFluidHandlerModifiable;\nimport net.minecraftforge.fluids.FluidStack;\n\npublic class FluidSlot {\n\t\n\tprivate final IFluidHandlerModifiable fluidHandler;\n\tprivate final int index;\n\tprivate final int x;\n\tprivate final int y;\n\t\n\tpublic int slotNumber;\n\t\n\tpublic FluidSlot(IFluidHandlerModifiable fluidHandler, int index, int x, int y) {\n\t\tthis.fluidHandler = fluidHandler;\n\t\tthis.index = index;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\t\n\tpublic boolean isFluidValid(FluidStack stack) {\n\t\tif (stack.isEmpty()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn fluidHandler.isFluidValid(index, stack);\n\t}\n\t\n\tpublic FluidStack getStack() {\n\t\treturn fluidHandler.getFluidInTank(index);\n\t}\n\t\n\tpublic void putStack(FluidStack stack) {\n\t\tfluidHandler.setFluidInTank(index, stack);\n\t}\n\t\n\tpublic int getSlotCapacity() {\n\t\treturn fluidHandler.getTankCapacity(index);\n\t}\n\t\n\tpublic int getX() {\n\t\treturn x;\n\t}\n\t\n\tpublic int getY() {\n\t\treturn y;\n\t}\n\t\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}\n}\n","new_contents":"package info.u_team.u_team_core.container;\n\nimport info.u_team.u_team_core.api.fluid.IFluidHandlerModifiable;\nimport net.minecraftforge.fluids.FluidStack;\n\npublic class FluidSlot {\n\t\n\tprivate final IFluidHandlerModifiable fluidHandler;\n\tprivate final int index;\n\tprivate final int x;\n\tprivate final int y;\n\t\n\tpublic int slotNumber;\n\t\n\tpublic FluidSlot(IFluidHandlerModifiable fluidHandler, int index, int x, int y) {\n\t\tthis.fluidHandler = fluidHandler;\n\t\tthis.index = index;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\t\n\tpublic boolean isFluidValid(FluidStack stack) {\n\t\tif (stack.isEmpty()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn fluidHandler.isFluidValid(index, stack);\n\t}\n\t\n\tpublic FluidStack getStack() {\n\t\treturn fluidHandler.getFluidInTank(index);\n\t}\n\t\n\tpublic void putStack(FluidStack stack) {\n\t\tfluidHandler.setFluidInTank(index, stack);\n\t}\n\t\n\tpublic int getSlotCapacity() {\n\t\treturn fluidHandler.getTankCapacity(index);\n\t}\n\t\n\tpublic IFluidHandlerModifiable getFluidHandler() {\n\t\treturn fluidHandler;\n\t}\n\t\n\tpublic int getX() {\n\t\treturn x;\n\t}\n\t\n\tpublic int getY() {\n\t\treturn y;\n\t}\n\t\n\tpublic boolean isEnabled() {\n\t\treturn true;\n\t}\n}\n","subject":"Add getter for the fluid handler"} {"old_contents":"package com.mapzen.android;\n\nimport com.mapzen.tangram.MapController;\n\n\/**\n * This is the main class of the Mapzen Android API and is the entry point for all methods related\n * to the map. You cannot instantiate a {@link MapzenMap} object directly. Rather you must obtain\n * one from {@link MapFragment#getMapAsync(MapView.OnMapReadyCallback)} or\n * {@link MapView#getMapAsync(MapView.OnMapReadyCallback)}.\n *\/\npublic class MapzenMap {\n private final MapController mapController;\n\n \/**\n * Creates a new map based on the given {@link MapController}.\n *\/\n MapzenMap(MapController mapController) {\n this.mapController = mapController;\n }\n\n \/**\n * Provides access to the underlying Tangram {@link MapController}.\n *\/\n public MapController getMapController() {\n return mapController;\n }\n}\n","new_contents":"package com.mapzen.android;\n\nimport com.mapzen.tangram.MapController;\n\n\/**\n * This is the main class of the Mapzen Android API and is the entry point for all methods related\n * to the map. You cannot instantiate a {@link MapzenMap} object directly. Rather you must obtain\n * one from {@link MapFragment#getMapAsync(OnMapReadyCallback)} or\n * {@link MapView#getMapAsync(OnMapReadyCallback)}.\n *\/\npublic class MapzenMap {\n private final MapController mapController;\n\n \/**\n * Creates a new map based on the given {@link MapController}.\n *\/\n MapzenMap(MapController mapController) {\n this.mapController = mapController;\n }\n\n \/**\n * Provides access to the underlying Tangram {@link MapController}.\n *\/\n public MapController getMapController() {\n return mapController;\n }\n}\n","subject":"FIx broken links in Javadoc"} {"old_contents":"\/*\n * Copyright 2012-2013 Continuuity,Inc. All Rights Reserved.\n *\/\n\npackage com.continuuity.api.procedure;\n\nimport java.io.IOException;\n\n\/**\n * This interface defines a response generator.\n *\/\npublic interface ProcedureResponder {\n \/**\n * Adds to the response to be returned to the caller.\n *\n * @param response An instance of {@link ProcedureResponse} containing the response to be returned.\n * @return An instance of {@link ProcedureResponse.Writer} for writing data of the response.\n * @throws IOException When there is issue sending the response to the callee.\n *\/\n ProcedureResponse.Writer response(ProcedureResponse response) throws IOException;\n}\n","new_contents":"\/*\n * Copyright 2012-2013 Continuuity,Inc. All Rights Reserved.\n *\/\n\npackage com.continuuity.api.procedure;\n\nimport java.io.IOException;\n\n\/**\n * This interface defines a response generator.\n *\/\npublic interface ProcedureResponder {\n \/**\n * Adds the response to be returned to the caller. Calling this method multiple times to the same\n * {@link ProcedureResponder} will return the same {@link ProcedureResponse.Writer} instance and the\n * latter submitted {@link ProcedureResponse} would be ignored.\n *\n * @param response An instance of {@link ProcedureResponse} containing the response to be returned.\n * @return An instance of {@link ProcedureResponse.Writer} for writing data of the response.\n * @throws IOException When there is issue sending the response to the callee.\n *\/\n ProcedureResponse.Writer response(ProcedureResponse response) throws IOException;\n}\n","subject":"Update javadocs to describe exactly how the method behaves."} {"old_contents":"package xyz.upperlevel.uppercore.economy;\n\nimport lombok.Getter;\nimport net.milkbowl.vault.economy.Economy;\nimport org.bukkit.Bukkit;\nimport org.bukkit.OfflinePlayer;\nimport org.bukkit.plugin.RegisteredServiceProvider;\nimport xyz.upperlevel.uppercore.Uppercore;\nimport xyz.upperlevel.uppercore.util.PluginUtil;\n\npublic class EconomyManager {\n @Getter\n private static boolean enabled = false;\n private static Economy economy;\n\n public static void enable() {\n Uppercore.logger().severe(\"Disabling economy until vault load\");\n enabled = false;\n\n PluginUtil.onPluginLoaded(\"Vault\", p -> {\n RegisteredServiceProvider rsp = Bukkit.getServicesManager().getRegistration(Economy.class);\n if (rsp == null) {\n Uppercore.logger().severe(\"Cannot find any economy service, economy not supported\");\n enabled = false;\n return;\n }\n enabled = true;\n economy = rsp.getProvider();\n });\n }\n\n public static Economy getEconomy() {\n return enabled ? economy : null;\n }\n\n public static Balance get(OfflinePlayer player) {\n return economy == null ? null : new Balance(player);\n }\n\n public static String format(double v) {\n return economy.format(v);\n }\n}\n","new_contents":"package xyz.upperlevel.uppercore.economy;\n\nimport lombok.Getter;\nimport net.milkbowl.vault.economy.Economy;\nimport org.bukkit.Bukkit;\nimport org.bukkit.OfflinePlayer;\nimport org.bukkit.plugin.RegisteredServiceProvider;\nimport xyz.upperlevel.uppercore.Uppercore;\nimport xyz.upperlevel.uppercore.util.PluginUtil;\n\npublic class EconomyManager {\n @Getter\n private static boolean enabled = false;\n private static Economy economy;\n\n public static void enable() {\n Uppercore.logger().info(\"Disabling economy until vault load\");\n enabled = false;\n\n PluginUtil.onPluginLoaded(\"Vault\", p -> {\n RegisteredServiceProvider rsp = Bukkit.getServicesManager().getRegistration(Economy.class);\n if (rsp == null) {\n Uppercore.logger().severe(\"Cannot find any economy service, economy not supported\");\n enabled = false;\n return;\n }\n enabled = true;\n economy = rsp.getProvider();\n });\n }\n\n public static Economy getEconomy() {\n return enabled ? economy : null;\n }\n\n public static Balance get(OfflinePlayer player) {\n return economy == null ? null : new Balance(player);\n }\n\n public static String format(double v) {\n return economy.format(v);\n }\n}\n","subject":"Convert severe \"Disabling economy until...\" to info"} {"old_contents":"package com.fsck.k9.message.html;\n\n\nimport org.jsoup.Jsoup;\nimport org.jsoup.nodes.Document;\nimport org.jsoup.safety.Cleaner;\nimport org.jsoup.safety.Whitelist;\n\n\npublic class HtmlSanitizer {\n private final HeadCleaner headCleaner;\n private final Cleaner cleaner;\n\n HtmlSanitizer() {\n Whitelist whitelist = Whitelist.relaxed()\n .addTags(\"font\", \"hr\", \"ins\", \"del\")\n .addAttributes(\"table\", \"align\", \"background\", \"bgcolor\", \"border\", \"cellpadding\", \"cellspacing\",\n \"width\")\n .addAttributes(\"tr\", \"align\", \"bgcolor\", \"valign\")\n .addAttributes(\"th\",\n \"align\", \"bgcolor\", \"colspan\", \"headers\", \"height\", \"nowrap\", \"rowspan\", \"scope\", \"sorted\",\n \"valign\", \"width\")\n .addAttributes(\"td\",\n \"align\", \"bgcolor\", \"colspan\", \"headers\", \"height\", \"nowrap\", \"rowspan\", \"scope\", \"valign\",\n \"width\")\n .addAttributes(\":all\", \"class\", \"style\", \"id\")\n .addProtocols(\"img\", \"src\", \"http\", \"https\", \"cid\", \"data\");\n\n cleaner = new Cleaner(whitelist);\n headCleaner = new HeadCleaner();\n }\n\n public Document sanitize(String html) {\n Document dirtyDocument = Jsoup.parse(html);\n Document cleanedDocument = cleaner.clean(dirtyDocument);\n headCleaner.clean(dirtyDocument, cleanedDocument);\n return cleanedDocument;\n }\n}\n","new_contents":"package com.fsck.k9.message.html;\n\n\nimport org.jsoup.Jsoup;\nimport org.jsoup.nodes.Document;\nimport org.jsoup.safety.Cleaner;\nimport org.jsoup.safety.Whitelist;\n\n\npublic class HtmlSanitizer {\n private final HeadCleaner headCleaner;\n private final Cleaner cleaner;\n\n HtmlSanitizer() {\n Whitelist whitelist = Whitelist.relaxed()\n .addTags(\"font\", \"hr\", \"ins\", \"del\")\n .addAttributes(\"font\", \"color\", \"face\", \"size\")\n .addAttributes(\"table\", \"align\", \"background\", \"bgcolor\", \"border\", \"cellpadding\", \"cellspacing\",\n \"width\")\n .addAttributes(\"tr\", \"align\", \"bgcolor\", \"valign\")\n .addAttributes(\"th\",\n \"align\", \"bgcolor\", \"colspan\", \"headers\", \"height\", \"nowrap\", \"rowspan\", \"scope\", \"sorted\",\n \"valign\", \"width\")\n .addAttributes(\"td\",\n \"align\", \"bgcolor\", \"colspan\", \"headers\", \"height\", \"nowrap\", \"rowspan\", \"scope\", \"valign\",\n \"width\")\n .addAttributes(\":all\", \"class\", \"style\", \"id\")\n .addProtocols(\"img\", \"src\", \"http\", \"https\", \"cid\", \"data\");\n\n cleaner = new Cleaner(whitelist);\n headCleaner = new HeadCleaner();\n }\n\n public Document sanitize(String html) {\n Document dirtyDocument = Jsoup.parse(html);\n Document cleanedDocument = cleaner.clean(dirtyDocument);\n headCleaner.clean(dirtyDocument, cleanedDocument);\n return cleanedDocument;\n }\n}\n","subject":"Add attributes for 'font' tag to the whitelist"} {"old_contents":"package ro.nicuch.citizensbooks;\n\nimport org.bukkit.configuration.file.YamlConfiguration;\nimport org.bukkit.inventory.ItemStack;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class ConfigUpdater {\n\n public static boolean updateConfig(CitizensBooksPlugin plugin, int oldVersion) {\n if (oldVersion == 7) {\n Map commandsMap = new HashMap<>();\n plugin.getSettings().getConfigurationSection(\"commands\").getKeys(false).forEach(str -> commandsMap.put(str, plugin.getSettings().getString(\"commands.\" + str)));\n plugin.getSettings().set(\"commands\", null);\n commandsMap.forEach((key, value) -> {\n plugin.getSettings().set(\"commands.\" + key + \".filter_name\", value);\n plugin.getSettings().set(\"commands.\" + key + \".permission\", \"none\"); \/\/default permission is to none\n });\n plugin.getSettings().set(\"lang.player_not_found\", ConfigDefaults.player_not_found);\n plugin.getSettings().set(\"lang.filter_not_found\", ConfigDefaults.filter_not_found);\n plugin.getSettings().set(\"lang.usage.forceopen\", ConfigDefaults.usage_forceopen);\n plugin.getSettings().set(\"lang.help.forceopen\", ConfigDefaults.help_forceopen);\n plugin.saveSettings(); \/\/save settings\n return true;\n }\n return false;\n }\n}\n","new_contents":"package ro.nicuch.citizensbooks;\n\nimport org.bukkit.configuration.file.YamlConfiguration;\nimport org.bukkit.inventory.ItemStack;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class ConfigUpdater {\n\n public static boolean updateConfig(CitizensBooksPlugin plugin, int oldVersion) {\n if (oldVersion == 7) {\n Map commandsMap = new HashMap<>();\n plugin.getSettings().getConfigurationSection(\"commands\").getKeys(false).forEach(str -> commandsMap.put(str, plugin.getSettings().getString(\"commands.\" + str)));\n plugin.getSettings().set(\"commands\", null);\n commandsMap.forEach((key, value) -> {\n plugin.getSettings().set(\"commands.\" + key + \".filter_name\", value);\n plugin.getSettings().set(\"commands.\" + key + \".permission\", \"none\"); \/\/default permission is to none\n });\n plugin.getSettings().set(\"lang.player_not_found\", ConfigDefaults.player_not_found);\n plugin.getSettings().set(\"lang.filter_not_found\", ConfigDefaults.filter_not_found);\n plugin.getSettings().set(\"lang.usage.forceopen\", ConfigDefaults.usage_forceopen);\n plugin.getSettings().set(\"lang.help.forceopen\", ConfigDefaults.help_forceopen);\n plugin.getSettings().set(\"version\", plugin.configVersion); \/\/update the version\n plugin.saveSettings(); \/\/save settings\n return true;\n }\n return false;\n }\n}\n","subject":"Update the version of the config too."} {"old_contents":"package replicant;\n\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.ScheduledExecutorService;\nimport java.util.concurrent.ScheduledFuture;\nimport java.util.concurrent.TimeUnit;\nimport javax.annotation.Nonnull;\nimport javax.annotation.Nullable;\n\n\/**\n * A thin abstraction for scheduling callbacks that works in JVM and GWT environments.\n *\/\nfinal class Scheduler\n{\n private static final SchedulerSupport c_support = new SchedulerSupport();\n\n public static void schedule( @Nonnull final SafeFunction command )\n {\n c_support.schedule( command );\n }\n\n \/**\n * JVM Compatible variant which will have fields and methods stripped out during GWT compile and thus fallback to GWT variant.\n *\/\n private static final class SchedulerSupport\n extends AbstractSchedulerSupport\n {\n @GwtIncompatible\n private final ScheduledExecutorService _executorService = Executors.newScheduledThreadPool( 1 );\n @GwtIncompatible\n @Nullable\n private ScheduledFuture _future;\n\n @GwtIncompatible\n @Override\n void schedule( @Nonnull final SafeFunction command )\n {\n final Runnable action = () -> {\n if ( !command.call() && null != _future )\n {\n _future.cancel( false );\n _future = null;\n }\n };\n _future = _executorService.scheduleAtFixedRate( action, 0, 1, TimeUnit.MILLISECONDS );\n }\n }\n\n private static abstract class AbstractSchedulerSupport\n {\n void schedule( @Nonnull final SafeFunction command )\n {\n com.google.gwt.core.client.Scheduler.get().scheduleIncremental( command::call );\n }\n }\n}\n","new_contents":"package replicant;\n\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.ScheduledExecutorService;\nimport java.util.concurrent.ScheduledFuture;\nimport javax.annotation.Nonnull;\nimport javax.annotation.Nullable;\n\n\/**\n * A thin abstraction for scheduling callbacks that works in JVM and GWT environments.\n *\/\nfinal class Scheduler\n{\n private static final SchedulerSupport c_support = new SchedulerSupport();\n\n public static void schedule( @Nonnull final SafeFunction command )\n {\n c_support.schedule( command );\n }\n\n \/**\n * JVM Compatible variant which will have fields and methods stripped out during GWT compile and thus fallback to GWT variant.\n *\/\n private static final class SchedulerSupport\n extends AbstractSchedulerSupport\n {\n @GwtIncompatible\n private final ScheduledExecutorService _executorService = Executors.newScheduledThreadPool( 1 );\n @GwtIncompatible\n @Nullable\n private ScheduledFuture _future;\n\n @GwtIncompatible\n @Override\n void schedule( @Nonnull final SafeFunction command )\n {\n \/\/noinspection StatementWithEmptyBody\n while ( command.call() )\n {\n }\n }\n }\n\n private static abstract class AbstractSchedulerSupport\n {\n void schedule( @Nonnull final SafeFunction command )\n {\n com.google.gwt.core.client.Scheduler.get().scheduleIncremental( command::call );\n }\n }\n}\n","subject":"Update scheduler to execute all the steps in success in the JVM"} {"old_contents":"package de.retest.recheck;\n\nimport java.util.Set;\n\nimport de.retest.recheck.ui.DefaultValueFinder;\nimport de.retest.recheck.ui.descriptors.RootElement;\n\n\/**\n * Interface to help recheck transform an arbitrary object into its internal format to allow persistence, state diffing\n * and ignoring of attributes and elements.\n *\/\npublic interface RecheckAdapter {\n\n\t\/**\n\t * Returns {@code true} if the given object can be converted by the adapter.\n\t *\n\t * @param toVerify\n\t * the object to verify\n\t * @return true if the given object can be converted by the adapter\n\t *\/\n\tboolean canCheck( Object toVerify );\n\n\t\/**\n\t * Convert the given object into a {@code RootElement} (respectively into a set of {@code RootElement}s if this is\n\t * sensible for this type of object).\n\t *\n\t * @param toVerify\n\t * the object to verify\n\t * @return The RootElement(s) for the given object\n\t *\/\n\tSet convert( Object toVerify );\n\n\t\/**\n\t * Returns a {@code DefaultValueFinder} for the converted element attributes. Default values of attributes are\n\t * omitted in the Golden Master to not bloat it.\n\t *\n\t * @return The DefaultValueFinder for the converted element attributes\n\t *\/\n\tDefaultValueFinder getDefaultValueFinder();\n\n}\n","new_contents":"package de.retest.recheck;\n\nimport java.util.Set;\n\nimport de.retest.recheck.report.ActionReplayResult;\nimport de.retest.recheck.ui.DefaultValueFinder;\nimport de.retest.recheck.ui.descriptors.RootElement;\n\n\/**\n * Interface to help recheck transform an arbitrary object into its internal format to allow persistence, state diffing\n * and ignoring of attributes and elements.\n *\/\npublic interface RecheckAdapter {\n\n\t\/**\n\t * Returns {@code true} if the given object can be converted by the adapter.\n\t *\n\t * @param toVerify\n\t * the object to verify\n\t * @return true if the given object can be converted by the adapter\n\t *\/\n\tboolean canCheck( Object toVerify );\n\n\t\/**\n\t * Convert the given object into a {@code RootElement} (respectively into a set of {@code RootElement}s if this is\n\t * sensible for this type of object).\n\t *\n\t * @param toVerify\n\t * the object to verify\n\t * @return The RootElement(s) for the given object\n\t *\/\n\tSet convert( Object toVerify );\n\n\t\/**\n\t * Returns a {@code DefaultValueFinder} for the converted element attributes. Default values of attributes are\n\t * omitted in the Golden Master to not bloat it.\n\t *\n\t * @return The DefaultValueFinder for the converted element attributes\n\t *\/\n\tDefaultValueFinder getDefaultValueFinder();\n\n\t\/**\n\t * Notifies about differences in the given {@code ActionReplayResult}.\n\t *\n\t * @param actionReplayResult\n\t * The {@code ActionReplayResult} containing differences to be notified about.\n\t *\/\n\tdefault void notifyAboutDifferences( final ActionReplayResult actionReplayResult ) {}\n\n}\n","subject":"Add possibility to warn adapter"} {"old_contents":"package com.namelessmc.api.utils;\n\nimport java.io.UnsupportedEncodingException;\nimport java.net.URLEncoder;\nimport java.util.UUID;\n\npublic class PostString {\n\t\n\tpublic static String getPlayerPostString(UUID uuid) {\n\t\ttry {\n\t\t\treturn \"uuid=\" + URLEncoder.encode(uuid.toString(), \"UTF-8\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tpublic static String getGroupPostString(String groupName) {\n\t\tString string = null;\n\t\ttry {\n\t\t\tstring = \"&group_id=\" + URLEncoder.encode(groupName, \"UTF-8\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn string;\n\t}\n\n}\n","new_contents":"package com.namelessmc.api.utils;\n\nimport java.io.UnsupportedEncodingException;\nimport java.net.URLEncoder;\n\npublic class PostString {\n\t\n\tpublic static String urlEncodeString(String string) {\n\t\ttry {\n\t\t\treturn URLEncoder.encode(string, \"UTF-8\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\t\/*public static String getPlayerPostString(UUID uuid) {\n\t\ttry {\n\t\t\treturn \"uuid=\" + URLEncoder.encode(uuid.toString(), \"UTF-8\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}*\/\n\t\n\t\/*public static String getGroupPostString(String groupName) {\n\t\tString string = null;\n\t\ttry {\n\t\t\tstring = \"&group_id=\" + URLEncoder.encode(groupName, \"UTF-8\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn string;\n\t}*\/\n\n}\n","subject":"Remove get post string methods"} {"old_contents":"\/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2007-2015 Broad Institute\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\/\n\npackage org.broad.igv.session;\n\nimport java.io.IOException;\nimport java.io.InputStream;\n\n\/**\n * @author Jim Robinson\n * @date 1\/12\/12\n *\/\npublic interface SessionReader {\n void loadSession(InputStream inputStream, Session session, String sessionName) throws IOException;\n}\n","new_contents":"\/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2007-2015 Broad Institute\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\/\n\npackage org.broad.igv.session;\n\nimport java.io.IOException;\nimport java.io.InputStream;\n\n\/**\n * @author Jim Robinson\n * @date 1\/12\/12\n *\/\npublic interface SessionReader {\n void loadSession(InputStream inputStream, Session session, String sessionPath) throws IOException;\n}\n","subject":"Fix bug affecting relative genome paths in sessions"} {"old_contents":"package openmods.container;\n\nimport net.minecraft.entity.player.EntityPlayer;\nimport net.minecraft.inventory.IInventory;\nimport net.minecraft.inventory.Slot;\nimport net.minecraft.item.ItemStack;\n\npublic class FakeSlot extends Slot implements ICustomSlot {\n\n\tprivate final boolean keepSize;\n\n\tpublic FakeSlot(IInventory inventory, int slot, int x, int y, boolean keepSize) {\n\t\tsuper(inventory, slot, x, y);\n\t\tthis.keepSize = keepSize;\n\t}\n\n\t@Override\n\tpublic ItemStack onClick(EntityPlayer player, int button, int modifier) {\n\t\tif (button == 2 && player.capabilities.isCreativeMode) {\n\t\t\tItemStack contents = getStack();\n\t\t\tif (contents != null) {\n\t\t\t\tItemStack tmp = contents.copy();\n\t\t\t\ttmp.stackSize = tmp.getMaxStackSize();\n\t\t\t\tplayer.inventory.setItemStack(tmp);\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t}\n\n\t\tItemStack held = player.inventory.getItemStack();\n\n\t\tItemStack place = null;\n\n\t\tif (held != null) {\n\t\t\tplace = held.copy();\n\t\t\tif (!keepSize) place.stackSize = 1;\n\t\t}\n\n\t\tinventory.setInventorySlotContents(slotNumber, place);\n\t\treturn place;\n\t}\n\n\t@Override\n\tpublic boolean canDrag() {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic boolean canTransferItemsOut() {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic boolean canTransferItemsIn() {\n\t\treturn false;\n\t}\n\n}\n","new_contents":"package openmods.container;\n\nimport net.minecraft.entity.player.EntityPlayer;\nimport net.minecraft.inventory.IInventory;\nimport net.minecraft.inventory.Slot;\nimport net.minecraft.item.ItemStack;\n\npublic class FakeSlot extends Slot implements ICustomSlot {\n\n\tprivate final boolean keepSize;\n\n\tpublic FakeSlot(IInventory inventory, int slot, int x, int y, boolean keepSize) {\n\t\tsuper(inventory, slot, x, y);\n\t\tthis.keepSize = keepSize;\n\t}\n\n\t@Override\n\tpublic ItemStack onClick(EntityPlayer player, int button, int modifier) {\n\t\tif (button == 2 && player.capabilities.isCreativeMode) {\n\t\t\tItemStack contents = getStack();\n\t\t\tif (contents != null) {\n\t\t\t\tItemStack tmp = contents.copy();\n\t\t\t\ttmp.stackSize = tmp.getMaxStackSize();\n\t\t\t\tplayer.inventory.setItemStack(tmp);\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t}\n\n\t\tItemStack held = player.inventory.getItemStack();\n\n\t\tItemStack place = null;\n\n\t\tif (held != null) {\n\t\t\tplace = held.copy();\n\t\t\tif (!keepSize) place.stackSize = 1;\n\t\t}\n\n\t\tinventory.setInventorySlotContents(slotNumber, place);\n\t\tonSlotChanged();\n\t\treturn place;\n\t}\n\n\t@Override\n\tpublic boolean canDrag() {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic boolean canTransferItemsOut() {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic boolean canTransferItemsIn() {\n\t\treturn false;\n\t}\n\n}\n","subject":"Fix update on fake slot"} {"old_contents":"\/**\n * Copyright 2011 The PlayN Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n * use this file except in compliance with the License. You may obtain a copy of\n * the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n *\/\npackage playn.android;\n\nimport android.graphics.Typeface;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport playn.core.AbstractFont;\n\nclass AndroidFont extends AbstractFont {\n\n public final Typeface typeface;\n\n public AndroidFont(String name, Style style, float size) {\n super(name, style, size);\n this.typeface = Typeface.create(name, TO_ANDROID_STYLE.get(style));\n }\n\n protected static final Map TO_ANDROID_STYLE = new HashMap();\n static {\n TO_ANDROID_STYLE.put(Style.PLAIN, Typeface.NORMAL);\n TO_ANDROID_STYLE.put(Style.BOLD, Typeface.BOLD);\n TO_ANDROID_STYLE.put(Style.ITALIC, Typeface.ITALIC);\n TO_ANDROID_STYLE.put(Style.BOLD_ITALIC, Typeface.BOLD_ITALIC);\n }\n}\n","new_contents":"\/**\n * Copyright 2011 The PlayN Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n * use this file except in compliance with the License. You may obtain a copy of\n * the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n *\/\npackage playn.android;\n\nimport android.graphics.Typeface;\n\nimport java.util.EnumMap;\nimport java.util.Map;\n\nimport playn.core.AbstractFont;\n\nclass AndroidFont extends AbstractFont {\n\n public final Typeface typeface;\n\n public AndroidFont(String name, Style style, float size) {\n super(name, style, size);\n this.typeface = Typeface.create(name, TO_ANDROID_STYLE.get(style));\n }\n\n protected static final Map TO_ANDROID_STYLE =\n new EnumMap(Style.class);\n static {\n TO_ANDROID_STYLE.put(Style.PLAIN, Typeface.NORMAL);\n TO_ANDROID_STYLE.put(Style.BOLD, Typeface.BOLD);\n TO_ANDROID_STYLE.put(Style.ITALIC, Typeface.ITALIC);\n TO_ANDROID_STYLE.put(Style.BOLD_ITALIC, Typeface.BOLD_ITALIC);\n }\n}\n","subject":"Use an EnumMap rather than a HashMap."} {"old_contents":"package com.github.kennedyoliveira.pastebin4j.api;\n\nimport org.junit.Test;\n\nimport static org.hamcrest.CoreMatchers.equalTo;\nimport static org.hamcrest.CoreMatchers.is;\nimport static org.hamcrest.CoreMatchers.nullValue;\nimport static org.junit.Assert.*;\n\n\/**\n * @author Kennedy Oliveira\n *\/\npublic class PasteUtilTest {\n\n @Test\n public void testGetPasteKeyFromUrl() throws Exception {\n\n final String pasteBinUrl = \"http:\/\/pastebin.com\/NCSQ6k9N\";\n\n assertThat(\"NCSQ6k9N\", is(equalTo(PasteUtil.getPasteKeyFromUrl(pasteBinUrl))));\n }\n\n @Test\n public void testGetPasteKeyFromUrlNullCase() throws Exception {\n assertThat(PasteUtil.getPasteKeyFromUrl(null), is(nullValue()));\n }\n\n @Test\n public void testGetPasteKeyFromInvalidUrl() throws Exception {\n try {\n PasteUtil.getPasteKeyFromUrl(\"http\/\/google.com\");\n fail(\"Should throwed IllegalArgumentException\");\n } catch (Exception e) {\n }\n\n }\n}","new_contents":"package com.github.kennedyoliveira.pastebin4j.api;\n\nimport org.junit.Test;\n\nimport static org.hamcrest.CoreMatchers.equalTo;\nimport static org.hamcrest.CoreMatchers.is;\nimport static org.hamcrest.CoreMatchers.nullValue;\nimport static org.junit.Assert.*;\n\n\/**\n * @author Kennedy Oliveira\n *\/\npublic class PasteUtilTest {\n\n @Test\n public void testGetPasteKeyFromUrl() throws Exception {\n\n final String pasteBinUrl = \"https:\/\/pastebin.com\/NCSQ6k9N\";\n\n assertThat(\"NCSQ6k9N\", is(equalTo(PasteUtil.getPasteKeyFromUrl(pasteBinUrl))));\n }\n\n @Test\n public void testGetPasteKeyFromUrlNullCase() throws Exception {\n assertThat(PasteUtil.getPasteKeyFromUrl(null), is(nullValue()));\n }\n\n @Test\n public void testGetPasteKeyFromInvalidUrl() throws Exception {\n try {\n PasteUtil.getPasteKeyFromUrl(\"http\/\/google.com\");\n fail(\"Should throwed IllegalArgumentException\");\n } catch (Exception e) {\n }\n\n }\n}\n","subject":"Fix tests to use HTTPS."} {"old_contents":"package blade.cli;\n\nimport blade.cli.cmds.Build;\nimport blade.cli.cmds.IDE;\nimport blade.cli.cmds.Type;\n\nimport java.io.File;\n\nimport org.osgi.framework.Version;\n\nimport aQute.lib.getopt.Arguments;\nimport aQute.lib.getopt.Description;\nimport aQute.lib.getopt.Options;\n\n@Arguments(arg = {\"name\", \"[service]\"})\n@Description(\"Creates a new Liferay module project.\")\npublic interface CreateOptions extends Options {\n\n\t@Description(\"If a class is generated in the project, \" +\n\t\t\"provide the name of the class to be generated.\" +\n\t\t\" If not provided defaults to Project name.\")\n\tpublic String classname();\n\n\t@Description(\"The build type of project to create. \"\n\t\t\t+ \"Valid values are maven or gradle. Default: gradle\")\n\tpublic Build build();\n\n\t@Description(\"The directory where to create the new project.\")\n\tpublic File dir();\n\n\t@Description(\"The type of IDE metadata to create along side \"\n\t\t\t+ \"the new project.\")\n\tpublic IDE ide();\n\n\t@Description(\"The type of Liferay module to create. \")\n\tpublic Type projectType();\n\n\t@Description(\"The version of Liferay to create the module for, \"\n\t\t\t+ \"by default its 7.0.0\")\n\tpublic Version version();\n\n}","new_contents":"package blade.cli;\n\nimport blade.cli.cmds.Build;\nimport blade.cli.cmds.IDE;\nimport blade.cli.cmds.Type;\n\nimport java.io.File;\n\nimport org.osgi.framework.Version;\n\nimport aQute.lib.getopt.Arguments;\nimport aQute.lib.getopt.Description;\nimport aQute.lib.getopt.Options;\n\n@Arguments(arg = {\"name\", \"[service]\"})\n@Description(\"Creates a new Liferay module project.\")\npublic interface CreateOptions extends Options {\n\n\t@Description(\"If a class is generated in the project, \" +\n\t\t\"provide the name of the class to be generated.\" +\n\t\t\" If not provided defaults to Project name.\")\n\tpublic String classname();\n\n\t@Description(\"The build type of project to create. \"\n\t\t\t+ \"Valid values are maven or gradle. Default: gradle\")\n\tpublic Build build();\n\n\t@Description(\"The directory where to create the new project.\")\n\tpublic File dir();\n\n\t@Description(\"The type of IDE metadata to create along side \"\n\t\t\t+ \"the new project.\")\n\tpublic IDE ide();\n\n\t@Description(\"The type of Liferay module to create. \"\n + \"Valid values are service, jspportlet, or portlet.\")\n\tpublic Type projectType();\n\n\t@Description(\"The version of Liferay to create the module for, \"\n\t\t\t+ \"by default its 7.0.0\")\n\tpublic Version version();\n\n}\n","subject":"Add valid values for projectType option of create command"} {"old_contents":"package com.xmunch.atomspace.aux;\n\npublic enum VisualizationParams {\n\n\tSIZE {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"size\";\n\t\t}\n\t},\n\tCOLOR {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"color\";\n\t\t}\n\t},\n\tFONT_COLOR {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"fontcolor\";\n\t\t}\n\t},\n\tSHAPE {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"shape\";\n\t\t}\n\t},\n\tLABEL {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"label\";\n\t\t}\n\t},\n\tARROW {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"arrow\";\n\t\t}\n\t},\n\tSTROKE {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"stroke\";\n\t\t}\n\t},\n\tWIDTH {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"width\";\n\t\t}\n\t},\n\tSPHERE {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"sphere\";\n\t\t}\n\t},\n\tCONE {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"cone\";\n\t\t}\n\t},\n\tDASHED {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"dashed\";\n\t\t}\n\t};\n\n\tpublic abstract String get();\n}\n","new_contents":"package com.xmunch.atomspace.aux;\n\npublic enum VisualizationParams {\n\n\tSIZE {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"size\";\n\t\t}\n\t},\n\tCOLOR {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"color\";\n\t\t}\n\t},\n\tFONT_COLOR {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"fontcolor\";\n\t\t}\n\t},\n\tSHAPE {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"shape\";\n\t\t}\n\t},\n\tLABEL {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"label\";\n\t\t}\n\t},\n\tARROW {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"arrow\";\n\t\t}\n\t},\n\tARROW_POSITION {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"arrow_position\";\n\t\t}\n\t},\n\tSTROKE {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"stroke\";\n\t\t}\n\t},\n\tSTRENGTH {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"strength\";\n\t\t}\n\t},\n\tWIDTH {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"width\";\n\t\t}\n\t},\n\tSPHERE {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"sphere\";\n\t\t}\n\t},\n\tCONE {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"cone\";\n\t\t}\n\t},\n\tDASHED {\n\t\t@Override\n\t\tpublic String get() {\n\t\t\treturn \"dashed\";\n\t\t}\n\t};\n\n\tpublic abstract String get();\n}\n","subject":"Increase number of visualization params"} {"old_contents":"package net.mcft.copy.betterstorage.inventory;\n\nimport net.mcft.copy.betterstorage.api.IKey;\nimport net.mcft.copy.betterstorage.misc.Constants;\nimport net.minecraft.entity.player.EntityPlayer;\nimport net.minecraft.item.ItemStack;\n\npublic class InventoryKeyring extends InventoryItem {\n\t\n\tpublic InventoryKeyring(EntityPlayer player, String title) {\n\t\tsuper(player, 9, (title.isEmpty() ? Constants.containerKeyring : title), !title.isEmpty());\n\t}\n\t\n\t@Override\n\tpublic boolean isItemValidForSlot(int slot, ItemStack stack) {\n\t\treturn ((stack != null) && (stack.getItem() instanceof IKey) &&\n\t\t ((IKey)stack.getItem()).isNormalKey());\n\t}\n\t\n\t@Override\n\tpublic void onInventoryChanged() {\n\t\tupdateStack();\n\t}\n\t\n\t@Override\n\tprotected void updateStack() {\n\t\tint count = 0;\n\t\tfor (ItemStack stack : allContents[0])\n\t\t\tif (stack != null) count++;\n\t\tstack.setItemDamage(count);\n\t\tsuper.updateStack();\n\t}\n\t\n}\n","new_contents":"package net.mcft.copy.betterstorage.inventory;\n\nimport net.mcft.copy.betterstorage.api.IKey;\nimport net.mcft.copy.betterstorage.misc.Constants;\nimport net.minecraft.entity.player.EntityPlayer;\nimport net.minecraft.item.ItemStack;\n\npublic class InventoryKeyring extends InventoryItem {\n\t\n\tpublic InventoryKeyring(EntityPlayer player, String title) {\n\t\tsuper(player, 9, (title.isEmpty() ? Constants.containerKeyring : title), !title.isEmpty());\n\t}\n\t\n\t@Override\n\tpublic boolean isItemValidForSlot(int slot, ItemStack stack) {\n\t\treturn ((stack == null) || ((stack.getItem() instanceof IKey) &&\n\t\t ((IKey)stack.getItem()).isNormalKey()));\n\t}\n\t\n\t@Override\n\tpublic void onInventoryChanged() {\n\t\tupdateStack();\n\t}\n\t\n\t@Override\n\tprotected void updateStack() {\n\t\tint count = 0;\n\t\tfor (ItemStack stack : allContents[0])\n\t\t\tif (stack != null) count++;\n\t\tstack.setItemDamage(count);\n\t\tsuper.updateStack();\n\t}\n\t\n}\n","subject":"Fix keys being stuck in keyring container"} {"old_contents":"package poussecafe.environment;\n\n\npublic class MessageListeners {\n\n public void include(MessageListener listener) {\n MessageListenerType priority = listener.priority();\n if(priority == MessageListenerType.FACTORY) {\n if(factoryListener == null) {\n factoryListener = listener;\n } else {\n throw new IllegalArgumentException(\"There is already a factory listener for message \" + listener.messageClass().getName());\n }\n } else if(priority == MessageListenerType.AGGREGATE) {\n if(aggregateListener == null) {\n aggregateListener = listener;\n } else {\n throw new IllegalArgumentException(\"There is already a aggregate listener for message \" + listener.messageClass().getName());\n }\n } else if(priority == MessageListenerType.REPOSITORY) {\n if(repositoryListener == null) {\n repositoryListener = listener;\n } else {\n throw new IllegalArgumentException(\"There is already a repository listener for message \" + listener.messageClass().getName());\n }\n } else {\n throw new UnsupportedOperationException(\"Unsupported priority \" + priority);\n }\n }\n\n private MessageListener factoryListener;\n\n private MessageListener aggregateListener;\n\n private MessageListener repositoryListener;\n}\n","new_contents":"package poussecafe.environment;\n\n\npublic class MessageListeners {\n\n public void include(MessageListener listener) {\n MessageListenerType priority = listener.priority();\n if(priority == MessageListenerType.FACTORY) {\n if(factoryListener == null) {\n factoryListener = listener;\n } else {\n throw new IllegalArgumentException(\"There is already a factory listener in \" + listener.aggregateRootClass().orElseThrow() + \" for message \" + listener.messageClass().getName());\n }\n } else if(priority == MessageListenerType.AGGREGATE) {\n if(aggregateListener == null) {\n aggregateListener = listener;\n } else {\n throw new IllegalArgumentException(\"There is already an aggregate listener in \" + listener.aggregateRootClass().orElseThrow() + \" for message \" + listener.messageClass().getName());\n }\n } else if(priority == MessageListenerType.REPOSITORY) {\n if(repositoryListener == null) {\n repositoryListener = listener;\n } else {\n throw new IllegalArgumentException(\"There is already a repository listener in \" + listener.aggregateRootClass().orElseThrow() + \" for message \" + listener.messageClass().getName());\n }\n } else {\n throw new UnsupportedOperationException(\"Unsupported priority \" + priority);\n }\n }\n\n private MessageListener factoryListener;\n\n private MessageListener aggregateListener;\n\n private MessageListener repositoryListener;\n}\n","subject":"Improve error message for message listeners consistency rules."} {"old_contents":"\/**\n * Licensed to jclouds, Inc. (jclouds) under one or more\n * contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. jclouds licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\n\npackage org.jclouds.karaf.recipe;\n\nimport com.google.common.base.Predicate;\nimport org.jclouds.util.Preconditions2;\n\npublic class RecipeProviderPredicates {\n\n public static Predicate id(final String id) {\n Preconditions2.checkNotEmpty(id, \"id must be defined\");\n return new Predicate() {\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public boolean apply(RecipeProvider recipeProvider) {\n return recipeProvider.getId().equals(id);\n }\n\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public String toString() {\n return \"id(\" + id + \")\";\n }\n };\n }\n}\n","new_contents":"\/**\n * Licensed to jclouds, Inc. (jclouds) under one or more\n * contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. jclouds licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\n\npackage org.jclouds.karaf.recipe;\n\nimport static com.google.common.base.Preconditions.checkNotNull;\nimport static com.google.common.base.Strings.emptyToNull;\n\nimport com.google.common.base.Predicate;\n\npublic class RecipeProviderPredicates {\n\n public static Predicate id(final String id) {\n checkNotNull(emptyToNull(id), \"id must be defined\");\n return new Predicate() {\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public boolean apply(RecipeProvider recipeProvider) {\n return recipeProvider.getId().equals(id);\n }\n\n \/**\n * {@inheritDoc}\n *\/\n @Override\n public String toString() {\n return \"id(\" + id + \")\";\n }\n };\n }\n}\n","subject":"Replace reference to non-existent Precondtions2"} {"old_contents":"package us.feras.mdv.demo;\n\nimport us.feras.mdv.MarkdownView;\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.widget.Button;\nimport android.widget.EditText;\n\npublic class MarkdownDataActivity extends Activity {\n\n\tEditText markdownEditText;\n\tMarkdownView markdownView;\n\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.markdown_view);\n\t\tmarkdownEditText = (EditText) findViewById(R.id.markdownText);\n\t\tmarkdownView = (MarkdownView) findViewById(R.id.markdownView);\n\t\tString text = \"## This is a demo of MarkdownView\" + \"\\n\" + \"* * *\" + \"\\n\" + \"### Edit the text and hit update to see the changes on the view.\";\n\t\tmarkdownEditText.setText(text);\n\t\tupdateMarkdownView();\n\n\t\tButton updateView = (Button) findViewById(R.id.updateButton);\n\t\tupdateView.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tupdateMarkdownView();\n\t\t\t}\n\t\t});\n\n\t}\n\n\tvoid updateMarkdownView() {\n\t\tmarkdownView.loadMarkDownData(markdownEditText.getText().toString());\n\t}\n}","new_contents":"package us.feras.mdv.demo;\n\nimport us.feras.mdv.MarkdownView;\nimport android.app.Activity;\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.widget.Button;\nimport android.widget.EditText;\n\npublic class MarkdownDataActivity extends Activity {\n\n\tEditText markdownEditText;\n\tMarkdownView markdownView;\n\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.markdown_view);\n\t\tmarkdownEditText = (EditText) findViewById(R.id.markdownText);\n\t\tmarkdownView = (MarkdownView) findViewById(R.id.markdownView);\n\t\tString text = \"## This is a demo of MarkdownView\" + \"\\n\" + \"* * *\" + \"\\n\" + \"### Edit the text and hit update to see the changes on the view.\";\n\t\tmarkdownEditText.setText(text);\n\t\tmarkdownView.setBackgroundColor(Color.parseColor(\"#EED8AE\"));\n\t\tupdateMarkdownView();\n\n\t\tButton updateView = (Button) findViewById(R.id.updateButton);\n\t\tupdateView.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tupdateMarkdownView();\n\t\t\t}\n\t\t});\n\n\t}\n\n\tvoid updateMarkdownView() {\n\t\tmarkdownView.loadMarkDownData(markdownEditText.getText().toString());\n\t}\n}","subject":"Change the background color for an example."} {"old_contents":"package net.sf.jabref;\n\nimport org.junit.Assert;\nimport org.junit.Test;\n\nimport java.util.Arrays;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertTrue;\n\npublic class JabRefCLITest {\n\n @Test\n public void testCLIParsingLongOptions() {\n JabRefCLI cli = new JabRefCLI(new String[] {\"--nogui\", \"--import=some\/file\", \"--output=some\/export\/file\"});\n\n Assert.assertEquals(\"[]\", Arrays.toString(cli.getLeftOver()));\n Assert.assertEquals(\"some\/file\", cli.getFileImport());\n Assert.assertTrue(cli.isDisableGui());\n Assert.assertEquals(\"some\/export\/file\", cli.getFileExport());\n }\n\n @Test\n public void testCLIParsingShortOptions() {\n JabRefCLI cli = new JabRefCLI(new String[] {\"-n\", \"-i=some\/file\", \"-o=some\/export\/file\"});\n\n Assert.assertEquals(\"[]\", Arrays.toString(cli.getLeftOver()));\n Assert.assertEquals(\"some\/file\", cli.getFileImport());\n Assert.assertTrue(cli.isDisableGui());\n Assert.assertEquals(\"some\/export\/file\", cli.getFileExport());\n }\n\n}","new_contents":"package net.sf.jabref;\n\nimport org.junit.Assert;\nimport org.junit.Test;\n\nimport java.util.Arrays;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertTrue;\n\npublic class JabRefCLITest {\n\n @Test\n public void testCLIParsingLongOptions() {\n JabRefCLI cli = new JabRefCLI(new String[] {\"--nogui\", \"--import=some\/file\", \"--output=some\/export\/file\"});\n\n Assert.assertEquals(\"[]\", Arrays.toString(cli.getLeftOver()));\n Assert.assertEquals(\"some\/file\", cli.getFileImport());\n Assert.assertTrue(cli.isDisableGui());\n Assert.assertEquals(\"some\/export\/file\", cli.getFileExport());\n }\n\n @Test\n public void testCLIParsingShortOptions() {\n JabRefCLI cli = new JabRefCLI(new String[] {\"-n\", \"-i=some\/file\", \"-o=some\/export\/file\"});\n\n Assert.assertEquals(\"[]\", Arrays.toString(cli.getLeftOver()));\n Assert.assertEquals(\"some\/file\", cli.getFileImport());\n Assert.assertTrue(cli.isDisableGui());\n Assert.assertEquals(\"some\/export\/file\", cli.getFileExport());\n }\n\n @Test\n public void testPreferencesExport() {\n JabRefCLI cli = new JabRefCLI(new String[] {\"-n\", \"-x=some\/file\"});\n\n Assert.assertEquals(\"[]\", Arrays.toString(cli.getLeftOver()));\n Assert.assertEquals(\"some\/file\", cli.getPreferencesExport());\n Assert.assertTrue(cli.isDisableGui());\n }\n\n}","subject":"Add test for export command line option"} {"old_contents":"package game;\n\nimport static com.google.common.base.Preconditions.checkArgument;\n\nimport java.util.Optional;\n\n\/**\n * Created by Dimitry on 14.05.2016.\n *\/\npublic class Board\n{\n private Player startingPlayer;\n private final int numberOfRows;\n private final int numberOfColumns;\n private Player[][] occupiers;\n\n public Board(final int numberOfRows, final int numberOfColumns) {\n this.numberOfRows = numberOfRows;\n this.numberOfColumns = numberOfColumns;\n occupiers = new Player[numberOfRows][numberOfColumns];\n }\n\n public Optional slotOwner(final int row, final int column) {\n if (occupiers[row][column] == null) {\n return Optional.empty();\n } else {\n return Optional.of(occupiers[row][column]);\n }\n }\n\n public void insertChip(final int columnNumber, final Player player) {\n int index = numberOfRows - 1;\n while (index >= 0 && occupiers[index][columnNumber] != null) {\n index--;\n }\n checkArgument(index >= 0);\n occupiers[index][columnNumber] = player;\n }\n\n public int getNumberOfRows() {\n return numberOfRows;\n }\n\n public int getNumberOfColumns() {\n return numberOfColumns;\n }\n\n public void setStartingPlayer(final Player player) {\n this.startingPlayer = player;\n }\n\n public Player getStartingPlayer() {\n return startingPlayer;\n }\n}\n","new_contents":"package game;\n\nimport static com.google.common.base.Preconditions.checkArgument;\n\nimport java.util.Optional;\n\n\/**\n * Created by Dimitry on 14.05.2016.\n *\/\npublic class Board\n{\n private final int numberOfRows;\n private final int numberOfColumns;\n private Player[][] occupiers;\n\n public Board(final int numberOfRows, final int numberOfColumns) {\n this.numberOfRows = numberOfRows;\n this.numberOfColumns = numberOfColumns;\n occupiers = new Player[numberOfRows][numberOfColumns];\n }\n\n public Optional slotOwner(final int row, final int column) {\n if (occupiers[row][column] == null) {\n return Optional.empty();\n } else {\n return Optional.of(occupiers[row][column]);\n }\n }\n\n public void insertChip(final int columnNumber, final Player player) {\n int index = numberOfRows - 1;\n while (index >= 0 && occupiers[index][columnNumber] != null) {\n index--;\n }\n checkArgument(index >= 0);\n occupiers[index][columnNumber] = player;\n }\n\n public int getNumberOfRows() {\n return numberOfRows;\n }\n\n public int getNumberOfColumns() {\n return numberOfColumns;\n }\n}\n","subject":"Revoke starting player from the board."} {"old_contents":"package com.naba.url.shortner;\n\nimport org.springframework.stereotype.Controller;\nimport org.springframework.ui.Model;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\n@Controller\npublic class UrlShortnerController {\n\n @RequestMapping(\"\/greeting\")\n public String greeting(@RequestParam(value=\"name\", required = false, defaultValue = \"World\") String name, Model model) {\n model.addAttribute(\"name\", name);\n return \"greeting\";\n }\n}\n","new_contents":"package com.naba.url.shortner;\n\nimport org.springframework.stereotype.Controller;\nimport org.springframework.ui.Model;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestMapping;\n\n@Controller\npublic class UrlShortnerController {\n\n @RequestMapping(\"\/\")\n public String landingPage() {\n return \"index\";\n }\n\n @RequestMapping(\"\/url-shortner\/{url}\")\n public String urlShortner(@PathVariable String url, Model model) {\n model.addAttribute(\"name\", url);\n return \"gretting\";\n }\n}\n","subject":"Update controller * Add mapping for index page * Update mapping to url-shortner html page"} {"old_contents":"import java.util.List; \n\nclass C005_ArrayInitialization {\n {\n String[] names = {\"Reinier\", \"Roel\"};\n String[] names2 = new String[]{\"Reinier\", \"Roel\"};\n String[] names3 = new java.lang.String[]{\"Reinier\", \"Roel\"};\n List[] list1 = new List[0];\n List[] list2 = new List[0];\n List[] list3 = new java.util.List[0];\n int[] sized = new int[0];\n int[][] sizedTwoDimensions = new int[0][0];\n int[][] sizedTwoDimensions2 = new int[0][];\n int[][][] sizedThreeDimensions = new int[0][][];\n int[][] empty = {{}};\n int[][] ints = new int[][] {{}};\n int[] singleInts = new int[] {};\n int more[] = {};\n int[] more2[] = {{}};\n }\n}","new_contents":"class C005_ArrayInitialization {\n {\n String[] names = {\"Reinier\", \"Roel\"};\n String[] names2 = new String[] {\"Reinier\", \"Roel\"};\n String[] names3 = new java.lang.String[] {\"Reinier\", \"Roel\"};\n int[] sized = new int[0];\n int[][] sizedTwoDimensions = new int[0][0];\n int[][] sizedTwoDimensions2 = new int[0][];\n int[][][] sizedThreeDimensions = new int[0][][];\n int[][] empty = {{}};\n int[][] ints = new int[][] {{}};\n int[] singleInts = new int[] {};\n int more[] = {};\n int[] more2[] = {{}};\n }\n}","subject":"Make the ArrayInitialization test also compile..."} {"old_contents":"package org.jvirtanen.parity.match;\n\npublic enum Side {\n BUY,\n SELL\n}\n","new_contents":"package org.jvirtanen.parity.match;\n\n\/**\n * The order side.\n *\/\npublic enum Side {\n BUY,\n SELL\n}\n","subject":"Add documentation for side in matching engine"} {"old_contents":"package com.openxc.measurements.serializers;\n\nimport java.io.IOException;\nimport java.io.StringWriter;\n\nimport java.text.DecimalFormat;\n\nimport com.fasterxml.jackson.core.JsonFactory;\nimport com.fasterxml.jackson.core.JsonGenerator;\n\nimport android.util.Log;\n\npublic class JsonSerializer implements MeasurementSerializer {\n private static final String TAG = \"JsonSerializer\";\n public static final String NAME_FIELD = \"name\";\n public static final String VALUE_FIELD = \"value\";\n public static final String EVENT_FIELD = \"event\";\n public static final String TIMESTAMP_FIELD = \"timestamp\";\n private static DecimalFormat sTimestampFormatter =\n new DecimalFormat(\"##########.000000\");\n\n public static String serialize(String name, Object value, Object event,\n Double timestamp) {\n StringWriter buffer = new StringWriter(64);\n JsonFactory jsonFactory = new JsonFactory();\n try {\n JsonGenerator gen = jsonFactory.createJsonGenerator(buffer);\n\n gen.writeStartObject();\n gen.writeStringField(NAME_FIELD, name);\n\n if(value != null) {\n gen.writeObjectField(VALUE_FIELD, value);\n }\n\n if(event != null) {\n gen.writeObjectField(EVENT_FIELD, event);\n }\n\n if(timestamp != null) {\n gen.writeNumberField(TIMESTAMP_FIELD, timestamp);\n }\n\n gen.writeEndObject();\n gen.close();\n } catch(IOException e) {\n Log.w(TAG, \"Unable to encode all data to JSON -- \" +\n \"message may be incomplete\", e);\n }\n return buffer.toString();\n }\n}\n","new_contents":"package com.openxc.measurements.serializers;\n\nimport java.io.IOException;\nimport java.io.StringWriter;\n\nimport java.text.DecimalFormat;\n\nimport com.fasterxml.jackson.core.JsonFactory;\nimport com.fasterxml.jackson.core.JsonGenerator;\n\nimport android.util.Log;\n\npublic class JsonSerializer implements MeasurementSerializer {\n private static final String TAG = \"JsonSerializer\";\n public static final String NAME_FIELD = \"name\";\n public static final String VALUE_FIELD = \"value\";\n public static final String EVENT_FIELD = \"event\";\n public static final String TIMESTAMP_FIELD = \"timestamp\";\n private static DecimalFormat sTimestampFormatter =\n new DecimalFormat(\"##########.000000\");\n\n public static String serialize(String name, Object value, Object event,\n Double timestamp) {\n StringWriter buffer = new StringWriter(64);\n JsonFactory jsonFactory = new JsonFactory();\n try {\n JsonGenerator gen = jsonFactory.createJsonGenerator(buffer);\n\n gen.writeStartObject();\n gen.writeStringField(NAME_FIELD, name);\n\n if(value != null) {\n gen.writeObjectField(VALUE_FIELD, value);\n }\n\n if(event != null) {\n gen.writeObjectField(EVENT_FIELD, event);\n }\n\n if(timestamp != null) {\n gen.writeFieldName(TIMESTAMP_FIELD);\n gen.writeRawValue(sTimestampFormatter.format(timestamp));\n }\n\n gen.writeEndObject();\n gen.close();\n } catch(IOException e) {\n Log.w(TAG, \"Unable to encode all data to JSON -- \" +\n \"message may be incomplete\", e);\n }\n return buffer.toString();\n }\n}\n","subject":"Use correct timestamp format in serialized JSON."} {"old_contents":"package org.codehaus.plexus.util;\n\nimport junit.framework.TestCase;\n\nimport java.util.Map;\nimport java.util.HashMap;\nimport java.io.StringReader;\nimport java.io.StringWriter;\n\nimport org.codehaus.plexus.context.DefaultContext;\n\n\/**\n * Generated by JUnitDoclet, a tool provided by ObjectFab GmbH under LGPL.\n * Please see www.junitdoclet.org, www.gnu.org and www.objectfab.de for\n * informations about the tool, the licence and the authors.\n *\/\npublic class ContextMapAdapterTest\n extends TestCase\n{\n public ContextMapAdapterTest( String name )\n {\n super( name );\n }\n\n public void testInterpolation()\n throws Exception\n {\n DefaultContext context = new DefaultContext();\n\n context.put( \"name\", \"jason\" );\n\n context.put( \"occupation\", \"exotic dancer\" );\n\n ContextMapAdapter adapter = new ContextMapAdapter( context );\n\n assertEquals( \"jason\", (String) adapter.get( \"name\" ) );\n\n assertEquals( \"exotic dancer\", (String) adapter.get( \"occupation\" ) );\n\n assertNull( adapter.get( \"foo\") );\n }\n}\n","new_contents":"package org.codehaus.plexus.util;\n\nimport java.io.StringReader;\nimport java.io.StringWriter;\n\nimport junit.framework.TestCase;\n\nimport org.codehaus.plexus.context.DefaultContext;\n\n\/**\n * Generated by JUnitDoclet, a tool provided by ObjectFab GmbH under LGPL.\n * Please see www.junitdoclet.org, www.gnu.org and www.objectfab.de for\n * informations about the tool, the licence and the authors.\n *\/\npublic class ContextMapAdapterTest\n extends TestCase\n{\n public ContextMapAdapterTest( String name )\n {\n super( name );\n }\n\n public void testInterpolation()\n throws Exception\n {\n DefaultContext context = new DefaultContext();\n\n context.put( \"name\", \"jason\" );\n\n context.put( \"occupation\", \"exotic dancer\" );\n\n ContextMapAdapter adapter = new ContextMapAdapter( context );\n\n assertEquals( \"jason\", (String) adapter.get( \"name\" ) );\n\n assertEquals( \"exotic dancer\", (String) adapter.get( \"occupation\" ) );\n\n assertNull( adapter.get( \"foo\") );\n }\n\n public void testInterpolationWithContext()\n throws Exception\n {\n DefaultContext context = new DefaultContext();\n context.put( \"name\", \"jason\" );\n context.put( \"noun\", \"asshole\" );\n\n String foo = \"${name} is an ${noun}. ${not.interpolated}\";\n\n InterpolationFilterReader reader =\n new InterpolationFilterReader( new StringReader( foo ), new ContextMapAdapter( context ) );\n\n StringWriter writer = new StringWriter();\n IOUtil.copy( reader, writer );\n\n String bar = writer.toString();\n assertEquals( \"jason is an asshole. ${not.interpolated}\", bar );\n }\n}\n","subject":"Add test from InterpolationFilterReaderTest, removing circular dependency."} {"old_contents":"\/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.facebook.presto.type;\n\nimport com.facebook.presto.operator.scalar.ScalarOperator;\nimport com.facebook.presto.spi.type.StandardTypes;\nimport io.airlift.slice.Slice;\n\nimport static com.facebook.presto.metadata.OperatorType.CAST;\n\npublic class HyperLogLogOperators\n{\n private HyperLogLogOperators()\n {\n }\n\n @ScalarOperator(CAST)\n @SqlType(StandardTypes.VARBINARY)\n public static Slice castToBinary(@SqlType(StandardTypes.HYPER_LOG_LOG) Slice slice)\n {\n return slice;\n }\n}\n","new_contents":"\/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.facebook.presto.type;\n\nimport com.facebook.presto.operator.scalar.ScalarOperator;\nimport com.facebook.presto.spi.type.StandardTypes;\nimport io.airlift.slice.Slice;\n\nimport static com.facebook.presto.metadata.OperatorType.CAST;\n\npublic class HyperLogLogOperators\n{\n private HyperLogLogOperators()\n {\n }\n\n @ScalarOperator(CAST)\n @SqlType(StandardTypes.VARBINARY)\n public static Slice castToBinary(@SqlType(StandardTypes.HYPER_LOG_LOG) Slice slice)\n {\n return slice;\n }\n\n @ScalarOperator(CAST)\n @SqlType(StandardTypes.HYPER_LOG_LOG)\n public static Slice castFromVarbinary(@SqlType(StandardTypes.VARBINARY) Slice slice)\n {\n return slice;\n }\n}\n","subject":"Add cast from varbinary to HLL"} {"old_contents":"package com.fedorvlasov.lazylist;\r\n\r\nimport android.app.Activity;\r\nimport android.content.Context;\r\nimport android.view.LayoutInflater;\r\nimport android.view.View;\r\nimport android.view.ViewGroup;\r\nimport android.widget.BaseAdapter;\r\nimport android.widget.ImageView;\r\nimport android.widget.TextView;\r\n\r\npublic class LazyAdapter extends BaseAdapter {\r\n \r\n private Activity activity;\r\n private String[] data;\r\n private static LayoutInflater inflater=null;\r\n public ImageLoader imageLoader; \r\n \r\n public LazyAdapter(Activity a, String[] d) {\r\n activity = a;\r\n data=d;\r\n inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r\n imageLoader=new ImageLoader(activity);\r\n }\r\n\r\n public int getCount() {\r\n return data.length;\r\n }\r\n\r\n public Object getItem(int position) {\r\n return position;\r\n }\r\n\r\n public long getItemId(int position) {\r\n return position;\r\n }\r\n \r\n public View getView(int position, View convertView, ViewGroup parent) {\r\n View vi=convertView;\r\n if(convertView==null)\r\n vi = inflater.inflate(R.layout.item, null);\r\n\r\n TextView text=(TextView)vi.findViewById(R.id.text);;\r\n ImageView image=(ImageView)vi.findViewById(R.id.image);\r\n text.setText(\"item \"+position);\r\n imageLoader.DisplayImage(data[position], image);\r\n return vi;\r\n }\r\n}","new_contents":"package com.fedorvlasov.lazylist;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\npublic class LazyAdapter extends BaseAdapter {\n \n private Activity activity;\n private String[] data;\n private static LayoutInflater inflater=null;\n public ImageLoader imageLoader; \n \n public LazyAdapter(Activity a, String[] d) {\n activity = a;\n data=d;\n inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n imageLoader=new ImageLoader(activity.getApplicationContext());\n }\n\n public int getCount() {\n return data.length;\n }\n\n public Object getItem(int position) {\n return position;\n }\n\n public long getItemId(int position) {\n return position;\n }\n \n public View getView(int position, View convertView, ViewGroup parent) {\n View vi=convertView;\n if(convertView==null)\n vi = inflater.inflate(R.layout.item, null);\n\n TextView text=(TextView)vi.findViewById(R.id.text);;\n ImageView image=(ImageView)vi.findViewById(R.id.image);\n text.setText(\"item \"+position);\n imageLoader.DisplayImage(data[position], image);\n return vi;\n }\n}","subject":"Revert \"Use activity context not application context\""} {"old_contents":"package com.visenze.visearch;\n\nimport java.util.Map;\n\npublic class ImageResult {\n\n private final String imName;\n private final Map metadata;\n private final Float score;\n\n public ImageResult(String imName, Map metatdata, Float score) {\n this.imName = imName;\n this.metadata = metatdata;\n this.score = score;\n }\n\n public String getImName() {\n return imName;\n }\n\n public Map getMetadata() {\n return metadata;\n }\n\n public Float getScore() {\n return score;\n }\n\n}\n","new_contents":"package com.visenze.visearch;\n\nimport java.util.Map;\n\npublic class ImageResult {\n\n private final String imName;\n private final Map metadata;\n private final Float score;\n\n public ImageResult(String imName, Map metatdata, Float score) {\n this.imName = imName;\n this.metadata = metatdata;\n this.score = score;\n }\n\n public String getImName() {\n return imName;\n }\n\n public Map getMetadata() {\n return metadata;\n }\n\n public Float getScore() {\n return score;\n }\n\n}\n","subject":"Use string value for metadata map in image result for now"} {"old_contents":"package linenux.control;\n\nimport java.nio.file.Paths;\n\nimport javafx.beans.property.ObjectProperty;\nimport javafx.beans.property.SimpleObjectProperty;\nimport linenux.command.result.CommandResult;\nimport linenux.model.Schedule;\nimport linenux.storage.XmlScheduleStorage;\n\n\/**\n * Controls data flow for the entire application.\n *\/\npublic class ControlUnit {\n private Schedule schedule;\n private XmlScheduleStorage scheduleStorage;\n private CommandManager commandManager;\n private ObjectProperty lastCommandResult = new SimpleObjectProperty<>();\n\n public ControlUnit() {\n this.scheduleStorage = new XmlScheduleStorage(getDefaultFilePath());\n this.schedule = (hasExistingSchedule()) ? getExistingSchedule() : new Schedule();\n this.commandManager = new CommandManager(schedule);\n }\n\n public CommandResult execute(String userInput) {\n CommandResult result = commandManager.delegateCommand(userInput);\n lastCommandResult.setValue(result);\n scheduleStorage.saveScheduleToFile(schedule);\n return result;\n }\n\n private boolean hasExistingSchedule() {\n return scheduleStorage.getFile().exists();\n }\n\n private Schedule getExistingSchedule() {\n return scheduleStorage.loadScheduleFromFile();\n }\n\n private String getDefaultFilePath() {\n return Paths.get(\".\").toAbsolutePath().toString();\n }\n\n public Schedule getSchedule() {\n return this.schedule;\n }\n\n public ObjectProperty getLastCommandResultProperty() {\n return this.lastCommandResult;\n }\n}\n","new_contents":"package linenux.control;\n\nimport java.nio.file.Paths;\n\nimport javafx.beans.property.ObjectProperty;\nimport javafx.beans.property.SimpleObjectProperty;\nimport linenux.command.result.CommandResult;\nimport linenux.model.Schedule;\nimport linenux.storage.XmlScheduleStorage;\n\n\/**\n * Controls data flow for the entire application.\n *\/\npublic class ControlUnit {\n private Schedule schedule;\n private XmlScheduleStorage scheduleStorage;\n private CommandManager commandManager;\n private ObjectProperty lastCommandResult = new SimpleObjectProperty<>();\n\n public ControlUnit() {\n this.scheduleStorage = new XmlScheduleStorage(getDefaultFilePath());\n\n if (this.hasExistingSchedule() && getSchedule() != null) {\n this.schedule = getSchedule();\n } else {\n this.schedule = new Schedule();\n }\n\n this.commandManager = new CommandManager(schedule);\n }\n\n public CommandResult execute(String userInput) {\n CommandResult result = commandManager.delegateCommand(userInput);\n lastCommandResult.setValue(result);\n scheduleStorage.saveScheduleToFile(schedule);\n return result;\n }\n\n private boolean hasExistingSchedule() {\n return scheduleStorage.getFile().exists();\n }\n\n private Schedule getExistingSchedule() {\n return scheduleStorage.loadScheduleFromFile();\n }\n\n private String getDefaultFilePath() {\n return Paths.get(\".\").toAbsolutePath().toString();\n }\n\n public Schedule getSchedule() {\n return this.schedule;\n }\n\n public ObjectProperty getLastCommandResultProperty() {\n return this.lastCommandResult;\n }\n}\n","subject":"Fix loading schedule from file"} {"old_contents":"\/*\n * Copyright 2015 Red Hat, Inc. and\/or its affiliates.\n *\n * Licensed under the Apache License version 2.0, available at http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\/\npackage org.wildfly.swarm.examples.transactions;\n\nimport org.jboss.shrinkwrap.api.ShrinkWrap;\nimport org.wildfly.swarm.container.Container;\nimport org.wildfly.swarm.jaxrs.JAXRSArchive;\nimport org.wildfly.swarm.transactions.TransactionsFraction;\n\n\/**\n * @author nmcl\n *\/\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n Container container = new Container();\n\n\t\/*\n * Use specific TransactionFraction even though it doesn't do\n\t * any more than the default one - for now.\n\t *\/\n\n container.subsystem(new TransactionsFraction(4712, 4713));\n\n \/\/ Start the container\n\n container.start();\n\n\t\/*\n * Now register JAX-RS resource class.\n\t *\/\n\n JAXRSArchive appDeployment = ShrinkWrap.create(JAXRSArchive.class);\n appDeployment.addResource(MyResource.class);\n\n container.deploy(appDeployment);\n }\n}\n","new_contents":"\/*\n * Copyright 2015 Red Hat, Inc. and\/or its affiliates.\n *\n * Licensed under the Apache License version 2.0, available at http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\/\npackage org.wildfly.swarm.examples.transactions;\n\nimport org.jboss.shrinkwrap.api.ShrinkWrap;\nimport org.wildfly.swarm.container.Container;\nimport org.wildfly.swarm.jaxrs.JAXRSArchive;\nimport org.wildfly.swarm.transactions.TransactionsFraction;\n\n\/**\n * @author nmcl\n *\/\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n Container container = new Container();\n\n\t\/*\n * Use specific TransactionFraction even though it doesn't do\n\t * any more than the default one - for now.\n\t *\/\n\n container.fraction(new TransactionsFraction(4712, 4713));\n\n \/\/ Start the container\n\n container.start();\n\n\t\/*\n * Now register JAX-RS resource class.\n\t *\/\n\n JAXRSArchive appDeployment = ShrinkWrap.create(JAXRSArchive.class);\n appDeployment.addResource(MyResource.class);\n\n container.deploy(appDeployment);\n }\n}\n","subject":"Remove subsystem() usage in favor of fraction()"} {"old_contents":"package com.janosgyerik.tools.util;\n\nimport java.util.Arrays;\n\npublic class MatrixUtils {\n\n private MatrixUtils() {\n \/\/ utility class, forbidden constructor\n }\n\n public static String toString(int[][] matrix) {\n StringBuilder builder = new StringBuilder();\n builder.append(\"[\");\n if (matrix.length > 0) {\n builder.append(Arrays.toString(matrix[0]));\n for (int i = 1; i < matrix.length; ++i) {\n builder.append(\", \").append(Arrays.toString(matrix[i]));\n }\n }\n builder.append(\"]\");\n return builder.toString();\n }\n}\n","new_contents":"package com.janosgyerik.tools.util;\n\nimport java.util.Arrays;\n\n\/**\n * Utility class to work with matrices\n *\/\npublic class MatrixUtils {\n\n private MatrixUtils() {\n \/\/ utility class, forbidden constructor\n }\n\n \/**\n * Format matrix as String, by joining Arrays.toString of each row\n * @param matrix the matrix to format\n * @return the matrix String\n *\/\n public static String toString(int[][] matrix) {\n StringBuilder builder = new StringBuilder();\n builder.append(\"[\");\n if (matrix.length > 0) {\n builder.append(Arrays.toString(matrix[0]));\n for (int i = 1; i < matrix.length; ++i) {\n builder.append(\", \").append(Arrays.toString(matrix[i]));\n }\n }\n builder.append(\"]\");\n return builder.toString();\n }\n}\n","subject":"Add documentation for public class and method"} {"old_contents":"package com.spiddekauga.utils;\n\n\/**\n * Various time methods\n *\/\npublic class Time {\n\/**\n * Causes the currently executing thread to sleep (temporarily cease\n * execution) for the specified number of milliseconds, subject to\n * the precision and accuracy of system timers and schedulers. The thread\n * does not lose ownership of any monitors.\n * @param millis the length of time to sleep in milliseconds\n * @throws IllegalArgumentException if the value of {@code millis} is negative\n *\/\npublic static void sleep(long millis) {\n\ttry {\n\t\tThread.sleep(millis);\n\t} catch (InterruptedException e) {\n\t\te.printStackTrace();\n\t}\n}\n}\n","new_contents":"package com.spiddekauga.utils;\n\nimport java.text.SimpleDateFormat;\nimport java.util.Locale;\n\n\/**\n * Various time methods\n *\/\npublic class Time {\n\/** ISO Date *\/\npublic static final String ISO_DATE = \"yyyy-MM-dd'T'HH:mm:ss.SSSX\";\n\n\/**\n * Create a simple date format from the ISO date\n * @return simple date format with ISO date\n *\/\npublic static SimpleDateFormat createIsoDateFormat() {\n\treturn new SimpleDateFormat(ISO_DATE, Locale.ENGLISH);\n}\n\n\/**\n * Causes the currently executing thread to sleep (temporarily cease execution) for the specified\n * number of milliseconds, subject to the precision and accuracy of system timers and schedulers.\n * The thread does not lose ownership of any monitors.\n * @param millis the length of time to sleep in milliseconds\n * @throws IllegalArgumentException if the value of {@code millis} is negative\n *\/\npublic static void sleep(long millis) {\n\ttry {\n\t\tThread.sleep(millis);\n\t} catch (InterruptedException e) {\n\t\te.printStackTrace();\n\t}\n}\n}\n","subject":"Add default ISO time formatter"} {"old_contents":"package com.emc.ecs.serviceBroker.config;\n\nimport java.net.URL;\n\nimport org.cloudfoundry.community.servicebroker.model.BrokerApiVersion;\nimport org.springframework.beans.factory.annotation.Value;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.ComponentScan;\nimport org.springframework.context.annotation.Configuration;\n\nimport com.emc.ecs.managementClient.Connection;\nimport com.emc.ecs.serviceBroker.repository.EcsRepositoryCredentials;\n\n@Configuration\n@ComponentScan(basePackages = \"com.emc.ecs.serviceBroker\")\npublic class BrokerConfig {\n\t\n\t@Value(\"${endpoint}\")\n\tprivate String endpoint;\n\t\n\t@Value(\"${port}\")\n\tprivate String port;\n\t\n\t@Value(\"${username}\")\n\tprivate String username;\n\t\n\t@Value(\"${password}\")\n\tprivate String password;\n\t\n\t@Value(\"${replicationGroup}\")\n\tprivate String replicationGroup;\n\t\n\t@Value(\"${namespace}\")\n\tprivate String namespace;\n\t\n\n\t@Bean\n\tpublic Connection ecsConnection() {\n\t\tURL certificate = getClass().getClassLoader().getResource(\"localhost.pem\");\n\t\treturn new Connection(\"https:\/\/\" + endpoint + \":\" + port, username, password, certificate);\n\t}\n\t\n\t@Bean\n\tpublic BrokerApiVersion brokerApiVersion() {\n\t\treturn new BrokerApiVersion(\"2.7\");\n\t}\n\t\n\t@Bean\n\tpublic EcsRepositoryCredentials getRepositoryCredentials() {\n\t\treturn new EcsRepositoryCredentials(null, null, namespace, replicationGroup);\n\t}\n}","new_contents":"package com.emc.ecs.serviceBroker.config;\n\nimport java.net.URL;\n\nimport org.cloudfoundry.community.servicebroker.model.BrokerApiVersion;\nimport org.springframework.beans.factory.annotation.Value;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.ComponentScan;\nimport org.springframework.context.annotation.Configuration;\n\nimport com.emc.ecs.managementClient.Connection;\nimport com.emc.ecs.serviceBroker.repository.EcsRepositoryCredentials;\n\n@Configuration\n@ComponentScan(basePackages = \"com.emc.ecs.serviceBroker\")\npublic class BrokerConfig {\n\t\n\t@Value(\"${endpoint}\")\n\tprivate String endpoint;\n\t\n\t@Value(\"${port}\")\n\tprivate String port;\n\t\n\t@Value(\"${username}\")\n\tprivate String username;\n\t\n\t@Value(\"${password}\")\n\tprivate String password;\n\t\n\t@Value(\"${replicationGroup}\")\n\tprivate String replicationGroup;\n\t\n\t@Value(\"${namespace}\")\n\tprivate String namespace;\n\t\n\t@Value(\"${repositoryUser}\")\n\tprivate String repositoryUser;\n\t\n\t@Value(\"${repositoryBucket}\")\n\tprivate String repositoryBucket;\n\t\n\n\t@Bean\n\tpublic Connection ecsConnection() {\n\t\tURL certificate = getClass().getClassLoader().getResource(\"localhost.pem\");\n\t\treturn new Connection(\"https:\/\/\" + endpoint + \":\" + port, username, password, certificate);\n\t}\n\t\n\t@Bean\n\tpublic BrokerApiVersion brokerApiVersion() {\n\t\treturn new BrokerApiVersion(\"2.7\");\n\t}\n\t\n\t@Bean\n\tpublic EcsRepositoryCredentials getRepositoryCredentials() {\n\t\treturn new EcsRepositoryCredentials(repositoryBucket, repositoryUser, namespace, replicationGroup);\n\t}\n}","subject":"Add repository user & broker vars"} {"old_contents":"\npackage org.tsugi;\n\n\/**\n * This is a class to provide access to the data for the logged-in user\n *\n * This data comes from the LTI launch from the LMS. \n * If this is an anonymous launch the User will be null.\n *\/\npublic interface User {\n\n public final int LEARNER_ROLE = 0;\n public final int INSTRUCTOR_ROLE = 1000;\n public final int TENANT_ADMIN_ROLE = 5000;\n public final int ROOT_ADMIN_ROLE = 10000;\n\n \/**\n * Get the launch associated with this object\n *\/\n public Launch getLaunch();\n\n \/**\n * The integer primary key for this user in this instance of Tsugi.\n *\/\n public Long getId();\n\n \/**\n * The user's email\n *\/\n public String getEmail();\n\n \/**\n * The user's display name\n *\/\n public String getDisplayname();\n\n \/**\n * Is the user a Mentor? (TBD)\n *\/\n public boolean isMentor();\n\n \/**\n * Is the user an instructor?\n *\/\n public boolean isInstructor();\n\n \/**\n * Is the user a Tenant Administrator?\n *\/\n public boolean isTenantAdmin();\n\n \/**\n * Is the user a Tsugi-wide Administrator?\n *\/\n public boolean isRootAdmin();\n\n}\n","new_contents":"\npackage org.tsugi;\n\n\/**\n * This is a class to provide access to the data for the logged-in user\n *\n * This data comes from the LTI launch from the LMS. \n * If this is an anonymous launch the User will be null.\n *\/\npublic interface User {\n\n public final int LEARNER_ROLE = 0;\n public final int INSTRUCTOR_ROLE = 1;\n public final int TENANT_ADMIN_ROLE = 1000;\n public final int ROOT_ADMIN_ROLE = 10000;\n\n \/**\n * Get the launch associated with this object\n *\/\n public Launch getLaunch();\n\n \/**\n * The integer primary key for this user in this instance of Tsugi.\n *\/\n public Long getId();\n\n \/**\n * The user's email\n *\/\n public String getEmail();\n\n \/**\n * The user's display name\n *\/\n public String getDisplayname();\n\n \/**\n * Is the user a Mentor? (TBD)\n *\/\n public boolean isMentor();\n\n \/**\n * Is the user an instructor?\n *\/\n public boolean isInstructor();\n\n \/**\n * Is the user a Tenant Administrator?\n *\/\n public boolean isTenantAdmin();\n\n \/**\n * Is the user a Tsugi-wide Administrator?\n *\/\n public boolean isRootAdmin();\n\n}\n","subject":"Change the instructor value to be the same as other impls"} {"old_contents":"package org.usfirst.frc.team997.robot.commands;\n\nimport org.usfirst.frc.team997.robot.RobotMap;\n\nimport edu.wpi.first.wpilibj.command.CommandGroup;\n\n\/**\n *\n *\/\npublic class AutoGearStraight extends CommandGroup {\n public AutoGearStraight() {\n \taddSequential(new DriveToDistance(-112 + RobotMap.Values.robotLength)); \/\/ drive backwards into gear deposit\n \taddSequential(new AutoDepositGear());\n }\n}\n","new_contents":"package org.usfirst.frc.team997.robot.commands;\n\nimport org.usfirst.frc.team997.robot.RobotMap;\n\nimport edu.wpi.first.wpilibj.command.CommandGroup;\n\n\/**\n *\n *\/\npublic class AutoGearStraight extends CommandGroup {\n public AutoGearStraight() {\n \taddSequential(new DriveToDistance(-110 + RobotMap.Values.robotLength)); \/\/ drive backwards into gear deposit\n \taddSequential(new AutoDepositGear());\n }\n}\n","subject":"Adjust values for Autonomous Straight routine"} {"old_contents":"package org.commonmark.test;\n\nimport org.junit.Test;\n\npublic class SpecialInputTest extends RenderingTestCase {\n\n @Test\n public void nullCharacterShouldBeReplaced() {\n assertRendering(\"foo\\0bar\", \"

      foo\\uFFFDbar<\/p>\\n\");\n }\n\n @Test\n public void nullCharacterEntityShouldBeReplaced() {\n assertRendering(\"foo�bar\", \"

      foo\\uFFFDbar<\/p>\\n\");\n }\n\n @Test\n public void crLfAsLineSeparatorShouldBeParsed() {\n assertRendering(\"foo\\r\\nbar\", \"

      foo\\nbar<\/p>\\n\");\n }\n\n @Test\n public void crLfAtEndShouldBeParsed() {\n assertRendering(\"foo\\r\\n\", \"

      foo<\/p>\\n\");\n }\n\n @Test\n public void surrogatePair() {\n assertRendering(\"surrogate pair: \\uD834\\uDD1E\", \"

      surrogate pair: \\uD834\\uDD1E<\/p>\\n\");\n }\n\n @Test\n public void surrogatePairInLinkDestination() {\n assertRendering(\"[title](\\uD834\\uDD1E)\", \"

      foo\\uFFFDbar<\/p>\\n\");\n }\n\n @Test\n public void nullCharacterEntityShouldBeReplaced() {\n assertRendering(\"foo�bar\", \"

      foo\\uFFFDbar<\/p>\\n\");\n }\n\n @Test\n public void crLfAsLineSeparatorShouldBeParsed() {\n assertRendering(\"foo\\r\\nbar\", \"

      foo\\nbar<\/p>\\n\");\n }\n\n @Test\n public void crLfAtEndShouldBeParsed() {\n assertRendering(\"foo\\r\\n\", \"

      foo<\/p>\\n\");\n }\n\n @Test\n public void mixedLineSeparators() {\n assertRendering(\"- a\\n- b\\r- c\\r\\n- d\", \"

      title<\/a><\/p>\\n\");\n }\n\n}\n","new_contents":"package org.commonmark.test;\n\nimport org.junit.Test;\n\npublic class SpecialInputTest extends RenderingTestCase {\n\n @Test\n public void nullCharacterShouldBeReplaced() {\n assertRendering(\"foo\\0bar\", \"